Syntax Trap #002



This content originally appeared on DEV Community and was authored by Tabea

Welcome to the second Syntax Trap.

Today’s all about comparing Arrays and Strings.

console.log([1, 2, 3] == "1,2,3");

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.


This content originally appeared on DEV Community and was authored by Tabea