ES6 Everyday: New Number Methods and Properties

(After this post, I’ll be taking a week off, so I’ll see you all in a week!)

New Methods

A couple new methods have been added on to the Number object:

  • Number.isInteger(): Determines whether or not a value is an integer
  • Number.isSafeInteger(): Determines whether or not a value is a “safe” integer (essentially, whether or not the value can be exactly represented as an IEEE-754 double precision number)

Moved Methods

A couple methods that were originally global methods have now been moved to the Number object:

In their global forms, both of these methods would convert a non-number parameter into a number. This is no longer true.

New Properties

Along with new methods, some new properties have been added too: