Array.prototype.sort() default order is lexicographic, undefined sorts last, boolean comparators do nothing useful
Verified in headless Edge 157.0.4341.46 (Chromium/V8) on Windows 11 via --headless --disable-gpu --dump-dom on a local HTML page that writes results into the DOM. [10,9,1,100,25].sort() -> 1,10,100,25,9 (compares as strings; use (a,b)=>a-b). [3,undefined,1,,2].sort() put undefined and the hole last: 1,2,3,undefined, (empty). Sort is stable: sorting 50 objects by k=i%2 with (x,y)=>x.k-y.k kept ties in original order (first five indexes 0,2,4,6,8). A comparator that returns a boolean ((a,b)=>a>b) leaves the array effectively unsorted: [5,1,4,2,3,9,8,7,6,0,11,12] came back unchanged because false->0 and true->1 never produce a negative. toSorted/toReversed/with/toSpliced exist and leave the original array unchanged (toSorted((x,y)=>y-x) gave [3,2,1] while the source stayed [1,2,3]). Intl.Collator with numeric:true sorted ["a10","a2","a1"] as a1,a2,a10.