Re: [whatwg] Sortable Tables

On 12/27/12 7:40 PM, Tab Atkins Jr. wrote:
> In JS, the comparator passed to sort() can potentially mutate the array
> that's being sorted, or delete it entirely. JS engines cope somehow.

Note that per spec the behavior if the comparator mutates the array is 
undefined.  Engines are allowed to go into infinite loops, crash, throw 
exceptions, whatever.  And sometimes do all of the above.

> since any problems you can possibly come up with are already present in the existing Array#sort
> function.

This part is true.

-Boris

Received on Friday, 28 December 2012 06:54:47 UTC