How JavaScript turns an empty array into text
In JavaScript, the `+` operator can either add numbers or join strings. When its operands are arrays, JavaScript first converts them to primitive values—basic values such as strings or numbers that the operator can work with directly.
An array’s usual string conversion joins its elements with commas. With no elements to join, an empty array converts to an empty string: `[].toString()` produces `""`. JavaScript performs that conversion on both sides of the `+` before deciding what the operator should do.
Why the result stays empty
Once both operands are strings, `+` means concatenation: placing one string after another. Joining an empty string to another empty string leaves nothing, so the result is `""`—a string containing zero characters, not an array and not a missing value.
That distinction explains why the expression can look like addition but produce no visible output. The operation is not adding two empty collections; it is converting each collection to text and joining that text. Add an element, and the conversion can produce characters to concatenate: for example, `[1] + []` evaluates to the string `"1"`.
![Why [] + [] becomes an empty string](https://cdn.stackyfacts.com/images/d1aa02bf-a013-4e2f-8dcf-21df6e97df10_back.jpg)





![C arrays allow reversed bracket notation like 5[a]](https://cdn.stackyfacts.com/images/8d1cb281-004c-4034-beec-f92b007ea3e7_back.jpg)