The datatype is used for various purposes in . Starting with ES6, has a number of improvements to help the save time as well as code efficiently. Here are some new features that ES6 brings to our favorite datatype. Number JavaScript Number programmer Binary and Octal Literals For starters, programmers can now use prefixes to represent the different number systems in ES6. So for representing binary digits, the can be used while for representing octal numbers, the can be used. prefix 0b prefix 0o Number.NaN different than its counterpart. It does not cast it’s input through Number(value) before comparision. Number.NaN is global returns if the provided value IS NaN. Number.NaN The confusing thing is, typeof NaN === number So, , does not accurately tell you if value is a number. It gives the set of all numbers AND NaN typeof value === number So, a more accurate way to determine if value is a number is: typeof value === ‘number’ && !Number.isNaN(value) Of course, other ways of working around values being incorrectly described as numbers include, which will return true for numbers only. Number(x) === x Number.isFinite differs from the global isFinite as well, in that does not cast values through Number(value) before evaluation. Number.isFinite Number.isFinite Global isFinite will evaluate non-numbers as finite!This is because global isFinite is casting values to Number(value) before evaluation. For instance, Non-numbers cast to numbers can equal 0. Number(null)===0 is superior in this regard. Number.isFinite Number.isInteger This is new in ES6, and will determine if a number is an integer. No casting to Number() is done, so you can be sure non-numbers like null will evaluate false. Number.parseInt, Number.parseFloat and behave exactly as their counterparts without exceptions. Number.parseInt Number.parseFloat global Number.MAX_SAFE_INTEGER, Number.MIN_SAFE_INTEGER These represent the largest and smallest numbers that can be safely and precisely represented in the JavaScript implementation, which is bounded by the IEEE floating point limit (IEEE 754) of 2⁵³-1 Of course, the MIN safe integer is the of the MAX number. Remember how computers store numbers in memory. negative Number.isSafeInteger Number.isSafeInteger simply returns if the provided number is between the MIN and MAX values above. Number.EPSILON Rounding errors occur in JavaScript when floating point (decimal) numbers cannot be represented accurately enough by the system. For instance, shockingly enough .1 plus .2 does not equal .3! provides an acceptable margin of error for use in computations. So, can be used to determine an acceptable margin of error, like this: Number.EPSILON Numbers in ES6 have come a long way and while there is still room for improvement, enhancements like this help to make ES6 better than previous JavaScript versions.