These number methods can be used on all JavaScript numbers:
Method Description
toString() Returns a number as a string
toExponetial() Returns a number written in exponential notation
toFixed() Returns a number written with a number of decimals
toPrecision() Returns a number written with a specified length
ValueOf() Returns a number as a number
Number() Returns a number converted from its argument.
parseFloat() Parses its argument and returns a floating point number
parseInt() Parses its argument and returns a whole number
Number Object Methods
These object methods belong to the Number object:
Method Description
Number.isInteger() Returns true if the argument is an integer
Number.isSafeInteger() Returns true if the argument is a safe integer
Number.parseFloat() Converts a string to a number
Number.parseInt() Converts a string to a whole number
Number Methods Cannot be Used on Variables
The number methods above belong to the JavaScript Number Object.
These methods can only be accessed like Number.isInteger().
Using X.isInteger() where X is a variable, will result in an error:
TypeError X.isInteger is not a function.
On this page of the site you can watch the video online Number Methods - JavaScript Tutorial - w3Schools - Chapter 21 - English with a duration of hours minute second in good quality, which was uploaded by the user w3Schools Tutorials 28 October 2022, share the link with friends and acquaintances, this video has already been watched 395 times on youtube and it was liked by 6 viewers. Enjoy your viewing!