Skip to main content

Posts

Showing posts with the label infinity

JavaScript - Undefined Infinity or Not a Number?

Had a heated discussion with a friend about a particular expression and so this blog with ready references for some basic JavaScript expressions.

ExpressionValueInfinityAnything beyond +/-1.7976931348623157e+308typeof Infinity"number"typeof NaN"number"typeof undefined"undefined"typeof null"object"Infinity + InfinityInfinityInfinity - InfinityNaN-Infinity + InfinityNaNInfinity / InfinityNaNInfinity * InfinityInfinityInfinity * 1InfinityInfinity / 1InfinityInfinity / 0InfinityInfinity * 0NaNInfinity - 1e308InfinityInfinity - 1e309NaN-Infinity + 1e308-Infinity-Infinity + 1e309NaNInfinity / 1e308Infinity1 * "a"NaN1 + NaNNaN1 * NaNNaNundefined + 1NaNundefined * 1NaNundefined + InfinityNaNundefined * InfinityNaNundefined + NaNNaNundefined * NaNNaNundefined + nullNaNundefined * nullNaN1 + null11 * null0null + null0null * null0Infinity + nullInfinityInfinity * nullNaNNaN + nullNaNNaN * nullNaN"" + Infinity"Infinity""&q…