denysdovhan / wtfjs

🤪 A list of funny and tricky JavaScript examples
http://bit.ly/wtfjavascript
Do What The F*ck You Want To Public License
34.99k stars 2.55k forks source link

Update adding arrays explanation #31

Closed yuezk closed 7 years ago

yuezk commented 7 years ago

I think when adding two arrays, its toString method is called first, and then toString calls join. As when we adding two objects, it prints [object Object][object Object].

denysdovhan commented 7 years ago

Thanks for contributing!