JS Numbers Flashcards
Number.isFinite(value)
Returns true if the value is a finite Number, otherwise it returns false
Number.isInteger(value)
Returns true if the value is an integer Number, otherwise it returns false
Number.isNaN(value)
Returns true if the value is Number.NaN, otherwise it returns false
Number.isSafeInteger(value)
Returns true if the value is a safe integer Number, otherwise it returns false
number. toExponential(?x)
x: An integer between 0 and 20 representing the number of digits in the notation after the decimal point. If omitted, it is set to as many digits as necessary to represent the value
Returns a String, representing the number as an exponential notation (i.e. 5.568e+0)
number.toFixed(?x)
x is the number of digits after the decimal point. Default is 0 (no digits after the decimal point)
Returns a String, representing a number, with the exact number of decimals
number. toPrecision(?x)
x: The number of digits. If omitted, it returns the entire number (without any formatting)
Returns a String, representing a number formatted to the specified precision
number.toString(?radix)
Returns a String, representing a number
number.valueOf()
Returns a Number, representing the primitive value of a number