Hacker News new | ask | show | jobs
by abdusco 1733 days ago
That's Javascript for you.

Summing arrays calls `.toString()` on them, and two empty string gives you a new empty string.

    [].toString() === ''
    [] + [] 
        === '' + '' 
        === ''
https://github.com/denysdovhan/wtfjs#adding-arrays