JavaScript – Working with Data Types
JavaScript has 8 Datatypes: String, Number, Bigint, Boolean, Undefined, Null, Symbol, and Object.
JavaScript has 8 Datatypes: String, Number, Bigint, Boolean, Undefined, Null, Symbol, and Object.
The Number constructor property returns the function that created the Number prototype.
The Number.isFinite() method returns true if a number is finite (not Infinity, -Infinity, or NaN).
The Number.isInteger() method returns true if a value is an integer of the datatype Number.
The Number.isFinite() method returns true if the value is NaN (not a number), yet the type is a Number.
The Number.isFinite() method returns true if a number is a safe integer, and also of a Number data type.
The Number.MAX_VALUE property returns the largest possible number in JavaScript, which is 1.7976931348623157e+308.
The Number.MIN_VALUE property returns the smallest possible number in JavaScript, which is 5e-324.
The Number.NEGATIVE_INFINITY property returns negative infinity.
The Number.POSITIVE_INFINITY property returns positive infinity.
The Number.prototype property allows the addition of new properties and methods to numbers.
The Number toExponential() method converts a number into exponential notation.
The Number toFixed() method converts a number to a string, while rounding the string to a specified number of decimals.
The Number toLocaleString() method returns a number as a string, using locale settings.
The Number toPrecision() method formats a number to a specified length, adding a decimal point and zeroes if necessary to achieve the length.
The Number valueOf() method returns the primitive value of a number.