Skip to content

Sorting

Guess the output · 1 of 3

The sort trap

1console.log([10, 9, 1, 100].sort().join(" "));
2console.log([10, 9, 1, 100].sort((a, b) => a - b).join(" "));

What does this print?