Skip to main content

JAVA SCRIPT NUMBER

JAVA SCRIPT NUMBER
var x = 3.14A number with decimals
var y = 34A number without decimals
var x = 123e512300000
var y = 123e-50.00123

NUMBER PROPERTIES
PROPERTIESDESCRIPTION
constructorReturns the function that created JavaScript's Number prototype
MAX_VALUE Returns the largest number possible in JavaScript
MIN_VALUEReturns the smallest number possible in JavaScript
NEGATIVE_INFINITYRepresents negative infinity (returned on overflow)
NaNRepresents a "Not-a-Number" value
POSITIVE_INFINITYRepresents infinity (returned on overflow)
prototypeAllows you to add properties and methods to an object

NUMBER METHODS
METHODDESCRIPTION
isFinite()Checks whether a value is a finite number
isInteger()Checks whether a value is an integer
isNaN()Checks whether a value is Number.NaN
isSafeInteger()Checks whether a value is a safe integer
toExponential(x)Converts a number into an exponential notation
toFixed(x)Formats a number with x numbers of digits after the decimal point
toPrecision(x)Formats a number to x length
toString()Converts a number to a string
valueOf()Returns the primitive value of a numbeR

Comments