News for hackers. Stuff that matters.
Re:Why does parseInt(1/0, 19) return 18? by lifthrasiir on Tuesday July 10, 2012 @04:46AM (#4222700)
To be exact, {} + {} is NaN only when used as a statement. In fact it is equivalent to {}; +{} which results in the last statement being evaluated as NaN. When you put parentheses around it (e.g. ({}+{})) it evaluates to "[object Object][object Object]", which should be obvious from [] + {} if it were indeed obvious.
Re:Why does parseInt(1/0, 19) return 18? by saurik on Tuesday July 10, 2012 @05:48PM (#4226399)
Yeah, the people talking about this are talking about it due to a five-minute lightning talk, and honestly it really bothers me that he is making people think that adding two objects together has that behavior when in fact it has nothing to do with objects at all: it has much more to do with automatic semi-colon insertion than with scary type conversion.