On Wed, Dec 1, 2010 at 2:45 AM, Peter van der Zee <e...@qfox.nl> wrote:
> Has an operator like >== ever been proposed? So the "strict" relational
> operator that returns NaN if typeof left and right don't match.
> If so, why was it shot down? Bloat? Relatively useless?

Well, > is used more often than >=. How would you spell "strict >"?

I think when people use >, >=, etc. they almost always suppose
(correctly or incorrectly) that the operands are sure to be both
numbers (or both strings). If they aren't, the programmer's
assumptions have already been violated; the code will likely misbehave
whatever answer the language gives. That is, even if the language
provided strict comparisons, and people used them, it probably
wouldn't help. This stands in contrast to code like `if (x ==
undefined)` where there may be no presupposition at all about what
sort of value x is.

-j
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to