-2

a couple of days ago I had a Javascript exam and the last question was:

When you evaluate the expression {} + [] what do you get?

  1. Error
  2. null
  3. 0
  4. undefined

I've tested in vscode but I can get an answer :(

Davin Tryon
  • 66,517
  • 15
  • 143
  • 132

1 Answers1

0

If you simply open your developer tools and type that expression in, you will see the return value as 0.

Scott Marcus
  • 64,069
  • 6
  • 49
  • 71