$ ./guess_the_language
Problem Solving — predict the output
Problem Solving — predict the output · easy · #133
What is the output?
console.log([3, 1, 2].sort());
[ 1, 2, 3 ]
[ 3, 1, 2 ]
[ 1, 3, 2 ]
[ 2, 1, 3 ]
Default sort compares strings, which happens to match numeric order for single digits.
Play Problem Solving ▸
◂ #132
all Problem Solving — predict the output questions
#134 ▸