Number Methods - JavaScript Tutorial - w3Schools - Chapter 21 - English

Publicado el: 28 octubre 2022
en el canal de: w3Schools Tutorials
395
6

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.


En esta página del sitio puede ver el video en línea Number Methods - JavaScript Tutorial - w3Schools - Chapter 21 - English de Duración hora minuto segunda en buena calidad , que subió el usuario w3Schools Tutorials 28 octubre 2022, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 395 veces y le gustó 6 a los espectadores. Disfruta viendo!