Ad
  • Custom User Avatar

    Agreed. I was having it edit the array in-place like the JS .sort() and my tests passed but the "submit" tests failed. It took me a minute to figure out why.

  • Custom User Avatar

    You should specify if it's OK to alter the list in-place or if a new copy should be created. The default JS sort function will sort an array in-place, which can be surprising. But it also means that it doesn't need to return anything. It's perfectly valid to say var l = [3,2,1].sort(); assert(l[0] === 1), because it mutates l rather than sorting into a new collection.