null >= 0

Javascript never stops surprising you.

Try this out.

then try

then once opon a time try this

What really happens is that the Greater-than-or-equal Operator (>=), performs type coercion (ToPrimitive), with a hint type of Number, actually all the relational operators have this behavior.

null is treated in a special way by the Equals Operator (==). In a brief, it only coerces to undefined:

Value such as false, ”, ‘0’, and [] are subject to numeric type coercion, all of them coerce to zero.

Facebooktwittergoogle_plusredditpinterestlinkedinmail

Leave a Reply

Your email address will not be published. Required fields are marked *