title: [].sort ignoring undefined values?
body: <p>I want to sort an array containing undefined/null and numbers, so that undefined/null values always come first: </p>
  
  <pre><code>function sorter(a, b) {
      if (a == b) return 0;
      if (a == undefined) return -1;
      if (b == undefined) return  1;
      return a - b;
  }
  </code></pre>
  
  <p>However, when the array contains an undefined value it becomes the last element</p>
  
  <pre><code>[-1, 0, 1, undefined, 2, 3].sort(sorter);     // [-1, 0, 1, 2, 3, undefined]
  </code></pre>
  
  <p>while it gets sorted correctly if the value is null</p>
  
  <pre><code>[-1, 0, 1, null, 2, 3].sort(sorter);          // [null, -1, 0, 1, 2, 3]
  </code></pre>
  
  <p>What am I doing wrong? Shouldn't this result in exactly the same order since null == undefined?</p>