5

Open up a console for example in Chrome or Firebug. Try the following:

console.log(0 >= null); /* true, so let's look closer: */
console.log(0 > null);  /* false, so it's got to be equal, right? */
console.log(0 == null); /* false again?? */

So, how can 0 be greater or equal >= null if it is neither greater > nor equal ==?

connexo
  • 53,704
  • 14
  • 91
  • 128
  • 2
    I tried `console.log(0<=null);` still `true` – Jozef Dúc Jun 11 '15 at 09:06
  • console.log(0<=0); // true console.log(0<-1); //false console.log(0<=-1); //false – Shushanth Pallegar Jun 11 '15 at 09:10
  • [Wat!?](https://www.destroyallsoftware.com/talks/wat) – deceze Jun 11 '15 at 09:48
  • "Despite the fact that null is a falsy value (i.e. it evaluates to false if coerced to a boolean), it isn't considered loosely equal to any of the other falsy values in JavaScript." http://adripofjavascript.com/blog/drips/equals-equals-null-in-javascript.html – Mathieu Nov 06 '19 at 16:53

0 Answers0