DEV Community

Cover image for Syntax Trap #003
Tabea
Tabea

Posted on

Syntax Trap #003

Today's questions is easy, right?!

console.log([10, 1, 3].sort());
Enter fullscreen mode Exit fullscreen mode

What's the result?

  1. [10, 1, 3]
  2. [1, 3, 10]
  3. [1, 10, 3]
  4. [10, 3, 1]

Two-thirds of my teammates tripped over this riddle today :D Do you know the correct answer without trying it out in the console?

Top comments (0)