- use the
0b
prefix for binary, and the0o
prefix for octal integer literals Number.isNaN
andNumber.isFinite
are like their global namesakes, except that they don’t coerce the argument to NumberNumber.parseInt
andNumber.parseFloat
are exactly the same as their global namesakes- use
Number.isInteger
to check if the argument is a Number value that doesn’t have a decimal part - use
Number.EPSILON
to check if the difference between two Number values is negligible (e.g. the difference between0.1 + 0.2
and0.3
is negligible) Number.MAX_SAFE_INTEGER
andNumber.MIN_SAFE_INTEGER
are the largest and smallest integers that can be safely and precisely represented in JavaScript- use
Number.isSafeInteger
to check if an integer is within those bounds
Read the full blog post here.