title: computed object property giving different result than dot notation
body: <p>I'm using a merge sort function. When I use the dot notation for the property I'm trying to use, it sorts them properly. I decided I wanted to be able to reuse the sort functionality on other properties, so I decided to make the property an argument in the function instead of it being hard coded. The problem is when I passed it the same property the items sorted differently. Not sure why this is happening.</p>
  
  <p>Here is the array of objects that I'm sorting based on the "points" property.</p>
  
  <pre><code>[ { teamNum: 0, points: 2, GD: -2, goals: 3, rank: 0 },
    { teamNum: 1, points: 2, GD: -2, goals: 3, rank: 0 },
    { teamNum: 2, points: 1, GD: -3, goals: 2, rank: 0 },
    { teamNum: 3, points: 4, GD: 1, goals: 4, rank: 0 },
    { teamNum: 4, points: 5, GD: 4, goals: 5, rank: 0 },
    { teamNum: 5, points: 4, GD: 2, goals: 6, rank: 0 } ]
  </code></pre>
  
  <p>working merge-sort function:</p>
  
  <p>*notice the <strong>.points</strong> in the <em>if</em> statement of merge</p>
  
  <pre><code>  function mergeSort(arr){
     var len = arr.length;
     if(len &lt;2)
        return arr;
     var mid = Math.floor(len/2),
         left = arr.slice(0,mid),
         right =arr.slice(mid);
     //send left and right to the mergeSort to break it down into pieces
     //then merge those
     return merge(mergeSort(left),mergeSort(right));
  }
  
  
  function merge(left, right){
    var result = [],
        lLen = left.length,
        rLen = right.length,
        l = 0,
        r = 0;
    while(l &lt; lLen &amp;&amp; r &lt; rLen){
       if(left[l].points &lt; right[r].points){
         result.push(left[l++]);
       }
       else{
         result.push(right[r++]);
      }
    }  
    //remaining part needs to be addred to the result
    return result.concat(left.slice(l)).concat(right.slice(r));
  }
  </code></pre>
  
  <p>invoking gives me the expected result:</p>
  
  <pre><code>let rankArr = mergeSort(Teams).reverse();
  console.log(rankArr);
  //outputs:
  
  [ { teamNum: 4, points: 5, GD: 4, goals: 5, rank: 0 },
    { teamNum: 3, points: 4, GD: 1, goals: 4, rank: 0 },
    { teamNum: 5, points: 4, GD: 2, goals: 6, rank: 0 },
    { teamNum: 0, points: 2, GD: -2, goals: 3, rank: 0 },
    { teamNum: 1, points: 2, GD: -2, goals: 3, rank: 0 },
    { teamNum: 2, points: 1, GD: -3, goals: 2, rank: 0 } ]
  </code></pre>
  
  <p><div class="snippet" data-lang="js" data-hide="true" data-console="true" data-babel="false">
  <div class="snippet-code snippet-currently-hidden">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const Teams = [ { teamNum: 0, points: 2, GD: -2, goals: 3, rank: 0 },
    { teamNum: 1, points: 2, GD: -2, goals: 3, rank: 0 },
    { teamNum: 2, points: 1, GD: -3, goals: 2, rank: 0 },
    { teamNum: 3, points: 4, GD: 1, goals: 4, rank: 0 },
    { teamNum: 4, points: 5, GD: 4, goals: 5, rank: 0 },
    { teamNum: 5, points: 4, GD: 2, goals: 6, rank: 0 } ]
    
  function mergeSort(arr) {
    var len = arr.length;
    if (len &lt; 2)
      return arr;
    var mid = Math.floor(len / 2),
      left = arr.slice(0, mid),
      right = arr.slice(mid);
    //send left and right to the mergeSort to break it down into pieces
    //then merge those
    return merge(mergeSort(left), mergeSort(right));
  }
  
  
  function merge(left, right) {
    var result = [],
      lLen = left.length,
      rLen = right.length,
      l = 0,
      r = 0;
    while (l &lt; lLen &amp;&amp; r &lt; rLen) {
      if (left[l].points &lt; right[r].points) {
        result.push(left[l++]);
      } else {
        result.push(right[r++]);
      }
    }
    //remaining part needs to be addred to the result
    return result.concat(left.slice(l)).concat(right.slice(r));
  }
  let rankArr = mergeSort(Teams).reverse();
  console.log(rankArr);</code></pre>
  </div>
  </div>
  </p>
  
  <p>Here's the mergeSort with a dynamic property</p>
  
  <pre><code>  function mergeSort(arr, prop){
     var len = arr.length;
     if(len &lt;2)
        return arr;
     var mid = Math.floor(len/2),
         left = arr.slice(0,mid),
         right =arr.slice(mid);
     //send left and right to the mergeSort to break it down into pieces
     //then merge those
     return merge(mergeSort(left),mergeSort(right), prop);
  }
  
  
  function merge(left, right, prop){
    var result = [],
        lLen = left.length,
        rLen = right.length,
        l = 0,
        r = 0;
    while(l &lt; lLen &amp;&amp; r &lt; rLen){
       if(left[l][prop] &lt; right[r][prop]){
         result.push(left[l++]);
       }
       else{
         result.push(right[r++]);
      }
    }  
    //remaining part needs to be addred to the result
    return result.concat(left.slice(l)).concat(right.slice(r));
  }
  
  //invoked
    let rankArr = mergeSort(Teams,"points").reverse();
  </code></pre>
  
  <p>Outputs:</p>
  
  <pre><code>[ { teamNum: 3, points: 4, GD: 1, goals: 4, rank: 0 },
    { teamNum: 4, points: 5, GD: 4, goals: 5, rank: 0 },
    { teamNum: 5, points: 4, GD: 2, goals: 6, rank: 0 },
    { teamNum: 0, points: 2, GD: -2, goals: 3, rank: 0 },
    { teamNum: 1, points: 2, GD: -2, goals: 3, rank: 0 },
    { teamNum: 2, points: 1, GD: -3, goals: 2, rank: 0 } ]
  </code></pre>
  
  <p><div class="snippet" data-lang="js" data-hide="true" data-console="true" data-babel="false">
  <div class="snippet-code snippet-currently-hidden">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const Teams = [ { teamNum: 0, points: 2, GD: -2, goals: 3, rank: 0 },
    { teamNum: 1, points: 2, GD: -2, goals: 3, rank: 0 },
    { teamNum: 2, points: 1, GD: -3, goals: 2, rank: 0 },
    { teamNum: 3, points: 4, GD: 1, goals: 4, rank: 0 },
    { teamNum: 4, points: 5, GD: 4, goals: 5, rank: 0 },
    { teamNum: 5, points: 4, GD: 2, goals: 6, rank: 0 } ]
    
  function mergeSort(arr, prop) {
    var len = arr.length;
    if (len &lt; 2)
      return arr;
    var mid = Math.floor(len / 2),
      left = arr.slice(0, mid),
      right = arr.slice(mid);
    //send left and right to the mergeSort to break it down into pieces
    //then merge those
    return merge(mergeSort(left), mergeSort(right), prop);
  }
  
  
  function merge(left, right, prop) {
    var result = [],
      lLen = left.length,
      rLen = right.length,
      l = 0,
      r = 0;
    while (l &lt; lLen &amp;&amp; r &lt; rLen) {
      if (left[l][prop] &lt; right[r][prop]) {
        result.push(left[l++]);
      } else {
        result.push(right[r++]);
      }
    }
    //remaining part needs to be addred to the result
    return result.concat(left.slice(l)).concat(right.slice(r));
  }
  
  //invoked
  console.log(mergeSort(Teams, "points").reverse());</code></pre>
  </div>
  </div>
  </p>