why (null <= 0) is true?
yuyuenjoy at gmail.com
Tue Sep 25 04:29:29 PDT 2012
i mean a set of rules should have its logic.
true > "azerty"' //false
true == "azerty"' //false
true >= "azerty"' // if here is true . is no wonder ?
2012/9/25 David Bruant <bruant.d at gmail.com>
> Le 25/09/2012 12:13, Frank Quan a écrit :
> > Hi, Brendan, thank you for reply.
> > I mean in common understanding, "a>=b" always have the same result
> > with " a>b || a==b ".
> Common understanding assumes a and b are numbers. I personally don't
> know if there is a common understanding of what 'true > "azerty"' could
> > But I noticed that in ES5/ES3, there are several cases breaking this
> > See the following:
> > null == 0 // false
> > null > 0 // false
> > null >= 0 // true
> > I was wondering if this is by design.
> > And, is it possible to have some change in future versions of ES?
> Regrettably, no. As a complement to Brendan's response, I recommand you
> to read the following paragraph
> Changing this in a future version of ECMAScript would "break the web"
> (break websites that rely on this broken behavior)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss