Thanks to Ajaxian for pointing out this amazingly detailed look at object to primitive coercion.
@pbakaus points out that Number.MAX_VALUE is close to infinity, but not too close.
This is a fun one with type coercion. It comes from John Resig’s explanation here:
More fun with implicit .toString() calls and also String instantiation
@jaffathecake has some more fun with IE. As we do.
@filmaj says, “I think it’s because object equality implicitly calls toString(), and in IE most native DOM objects return just ‘[object]’ in toString(), whereas standard browser return something like ‘[object ClassName]’, which is probably why WebKit doesn’t do the same thing.”
Fuckin IE, eh.
Interesting how IE and WebKit treat this differently than Firefox and Opera. Some sort of pre-compilation going on? Who knows. Thanks @jeronevw!