Name

Number — NN 3 IE J2 ECMA 1

Synopsis

A Number object represents any numerical value, whether it is an integer or floating-point number. By and large, you don’t have to worry about the Number object because a numerical value automatically becomes a Number object instance whenever you use such a value or assign it to a variable. On the other hand, you might want access to the static properties that only a math major would love.

Creating a Number Object

var myValue = number
var myValue = new Number(number)

Properties

MAX_VALUE
NaN
NEGATIVE_INFINITY
POSITIVE_INFINITY
prototype
MIN_VALUE

Methods

toString()
valueOf()

Get Dynamic HTML: The Definitive Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.