title: Why my JavaScript 2D array is being sorted when pushing a new element?
body: <p>I'm writing a function that takes a given word as a parameter and returns its characters' position based on this 2D array:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>let keyboard = [
    ["a", "b", "c", "d", "e", "1", "2", "3"],
    ["f", "g", "h", "i", "j", "4", "5", "6"],
    ["k", "l", "m", "n", "o", "7", "8", "9"],
    ["p", "q", "r", "s", "t", ".", "@", "0"],
    ["u", "v", "w", "x", "y", "z", "_", "/"],
  ];
  
  function tvRemote(word) {
    let arr = [...word];
    let position = [];
    for (let rows = 0; rows &lt; keyboard.length; rows++) {
      for (let cols = 0; cols &lt; keyboard[rows].length; cols++) {
        for (i of arr) {
          keyboard[rows][cols] === i ? position.push([i, rows, cols]) : null;
        }
      }
    }
    return position;
  }
  console.log( tvRemote("your") );</code></pre>
  </div>
  </div>
  </p>
  <p>I'd like to get the position in order to perform some calculations, but when pushing the rows and cols to the position array, the return seems to get sorted.</p>
  <p>Expected output:</p>
  <pre><code>[ [ 'y', 4, 4 ], [ 'o', 2, 4 ], [ 'u', 4, 0 ], [ 'r', 3, 2 ] ]
  </code></pre>
  <p>What I'm getting:</p>
  <pre><code>[ [ 'o', 2, 4 ], [ 'r', 3, 2 ], [ 'u', 4, 0 ], [ 'y', 4, 4 ] ]
  </code></pre>
  <p>Does anyone know what's going on? and if so, how can I prevent that auto sort?</p>