Re:JSFuck (2012)
by colordrops on Sunday September 26, 2021 @03:03AM
(#28658989)
"+" isn't some singular operator. They are different operators for different types using the same character. You'd have to memorize a table of all JS types and what "+" does for each, which is silly considering that the only place it should really be used in modern JS is arithmetic and the occasional string concatenation.
[ Parent
| on HN ]
afaik these two places ( arithmetic and string concatenation ) are the only ones where + operation is defined. JS picks one of these two operations and casts the operands accordingly.
Edit: Wait, there is also the unary + which takes only one argument, but it also could be considered arithmetic.