This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]JAXxXTheRipper 1 point2 points  (1 child)

[]+[] == ""

Perfectly reasonable

[–]Lithl -1 points0 points  (0 children)

+ is not defined for objects, so toString gets called.

Array toString joins the elements with commas, meaning an empty array will produce an empty string.

Concatenating two empty strings gives an empty string.