denysdovhan / wtfjs

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

Explanation to baNaNa #46

Closed ricardo-kagawa closed 7 years ago

ricardo-kagawa commented 7 years ago

The explanation to "baNaNa" does indicate that the second plus is actually an unary plus operator, which is (in my opinion) key to understanding the trick, yet the reference only lists the binary plus (numeric addition/string concatenation), which is not as important and is a completely different operator.

Here is the reference to unary plus:

12.5.6 Unary + Operator