DEV Community

Discussion on: JavaScript Quiz Part 3

Collapse
 
antogarand profile image
Antony Garand

The + operator can either concatenate two elements or perform an addition.

In the first case, it will convert both elements to strings, the array being an empty string and the second one being [Object object].

Second does pretty much the same thing, [] = '', 0 = '0', '' + '0' = '0'
And the others are similar.