Skip to content
Onsite

Output: [] + [], [] + {}, 1 + "2", "3" - 1, true + 1

EasyP1Output

What does this code print?

1console.log(JSON.stringify([] + []));
2console.log([] + {});
3console.log(1 + '2');
4console.log('3' - 1);
5console.log(true + 1);
Saved automatically

One line per console.log. Arrays as [1, 2, 3], objects as { a: 1 }, an uncaught error as Uncaught TypeError: message (Chrome and Node wording).

Hints

Saved automatically