Javascript Number Objects - Properties and Methods
Description
A number object holds primitive numeric values.
Can be created by number constructor, for example, new Number(value) or Number (value), where "value" is the numeric value of the Number object to be created, or value to be converted to a number.
Javascript Number Objects Property
Name | Description | Version |
---|---|---|
constructor | Specifies the function that creates an object's prototype. | Implemented in JavaScript 1.1 |
MAX_VALUE | Returns the maximum numeric value represented in JavaScript. | Implemented in JavaScript 1.1 |
MIN_VALUE | Returns the number closest to 0, not the negative number represented in JavaScript. | Implemented in JavaScript 1.1 |
NaN | Represents a value that is not a number | Implemented in JavaScript 1.1 |
NEGATIVE_INFINITY | A special numeric value represents negative infinity. | Implemented in JavaScript 1.1 |
POSITIVE_INFINITY | A special numeric value represents positive infinity. | Implemented in JavaScript 1.1 |
prototype | Allows the add of properties to a Number object. | Implemented in JavaScript 1.1 |
Javascript Number Objects Methods
Name | Description | Version |
---|---|---|
toSource | Use to get a string representation (source code) of the number object. | Implemented in JavaScript 1.3 |
toString | Use to get a string representation of the specified number object. | Implemented in JavaScript 1.1 |
valueOf | Returns the primitive value of a number object as a number data type. | Implemented in JavaScript 1.1 |
See also:
Test your Programming skills with w3resource's quiz.
It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.
https://www.w3resource.com/javascript/object-property-method/number.php
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics