Array.sort() default Playground

arr.sort() shunts the wagons of train #1 itself: what does it compare when it gets no comparator? With one, every comparison the engine made is logged and…

The key idea

With no comparator sort orders text; a comparator gives a number

Try it in this playground