DEV Community

Cover image for Syntax Trap #002
Tabea
Tabea

Posted on

Syntax Trap #002

Welcome to the second Syntax Trap.

Today's all about comparing Arrays and Strings.

console.log([1, 2, 3] == "1,2,3");
Enter fullscreen mode Exit fullscreen mode

What's the result?

  1. NaN
  2. true
  3. false
  4. TypeError

This one took me a bit to understand when I started to learn JavaScript as I was used to how other programming languages work.

Top comments (0)