$ ./guess_the_language
Problem Solving — predict the output
Problem Solving — predict the output · medium · #61
What is the output?
console.log([3, 1, 20, 10].sort());
[1, 10, 20, 3]
[1, 3, 10, 20]
[3, 1, 20, 10]
[20, 10, 3, 1]
The default sort compares values as strings, so '10' sorts before '3'.
Play Problem Solving ▸
◂ #60
all Problem Solving — predict the output questions
#62 ▸