js-test-33

Array? Object? Undefined? What’s the output?

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

In JavaScript, the + operator doesn’t do the concatenation of arrays.

Instead, it transforms them into strings and then does the string concatenation.

Two empty arrays become two empty strings, and their sum unsurprisingly is still an empty string.

What matters to us is the typeof that will return string in our case.


ANSWER: the output will be string.