What does [] + [] evaluate to in JavaScript?

The story behind the answer

In JavaScript, `[] + []` evaluates to an empty string (`""`). The plus operator can mean either numeric addition or string concatenation, and here both empty arrays are converted to primitive values before the operation proceeds.

An array’s default string representation is produced by joining its elements with commas. Because both arrays contain no elements, `String([])` becomes `""`. JavaScript therefore concatenates `""` with `""`, producing another empty string rather than an array, number, `undefined`, or `null`.

This result is a classic example of JavaScript’s implicit type coercion. It differs from expressions such as `[] + [1, 2]`, which produces the string `"1,2"`, or `[1] + [2]`, which produces `"12"`. The empty array is still an object and is truthy in a Boolean context; its conversion to an empty string happens specifically because the plus expression requests primitive values. Using `Number([])` separately would instead produce `0`, which explains another frequent source of confusion.

Source: Wikipedia · fact-checked Aug. 2026

Add question to a list

Choose a list to keep this question in: