Javascript - Number class Reference

Introduction

JavaScript Number class has helper methods for number processing.

Property

PropertyDescription
Number constructor PropertyIn JavaScript, the constructor property returns the constructor function for an object.
Number MAX_VALUE PropertyThe MAX_VALUE property returns the largest number possible in JavaScript.
Number MIN_VALUE PropertyThe MIN_VALUE property returns the smallest positive number possible in JavaScript.
Number NEGATIVE_INFINITY PropertyThe NEGATIVE_INFINITY property represents negative infinity.
Number NaN PropertyThe NaN property represents "Not-a-Number" value. This property indicates that a value is not a legal number.
Number POSITIVE_INFINITY PropertyThe POSITIVE_INFINITY property represents positive infinity.
Number prototype PropertyThe prototype constructor can add new properties and methods to JavaScript Number class.

Method

MethodDescription
Number isFinite() MethodThe Number.isFinite() method returns whether a value is a finite number.
Number isInteger() MethodThe Number.isInteger() method determines whether a value an integer.
Number isNaN() MethodThe Number.isNaN() method determines whether a value is NaN (Not-A-Number).
Number isSafeInteger() MethodThe Number.isSafeInteger() method determines whether a value is a safe integer.
Number toExponential() MethodThe toExponential() method converts a number into an exponential notation.
Number toFixed() MethodThe toFixed() method converts a number into a string keeping a specified number of decimals.
Number toPrecision() MethodThe toPrecision() method formats a number to a specified length.
Number toString() MethodThe toString() method converts a number to a string.
Number valueOf() MethodThe valueOf() method returns the primitive value of a number.