JavaScript | Number constructor Property
The Number constructor Property in Javascript is used to return the number constructor function for the object. The function which is returned by this property is just the reference to this function not a number containing the function’s name. The JavaScript number constructor, string constructor and boolean constructor returns function Number() { [native code] }, function String() { [native code] } and function Boolean() { [native code] } respectively.
Syntax:
number.constructor
Return Value: This function returns the Number() { [native code].
Example:
<!DOCTYPE html> <html> <head> <title> JavaScript number constructor Property </title> </head> <body style="text-align:center;"> <h2> Welcome to GeeksforGeeks </h2> <p> Click the button to see number contructor property. </p> <button onclick="myGeeks()"> click me </button> <p id="GFG" style="font-size:20px;" ></p> <!--Script to use string constructor property--> <script> function myGeeks() { var num = 420; document.getElementById("GFG").innerHTML = num.constructor; } </script> </body> </html> |
Output :
- Before Clicking On Button:

- After Clicking On Button:

Supported Browsers: The browser supported by Number constructor property are listed below:
- Google Chrome
- Internet Explorer
- Firefox
- Safari
- Opera
Recommended Posts:
- JavaScript | String constructor Property
- JavaScript | Boolean constructor Property
- JavaScript | Date constructor Property
- JavaScript | Array constructor Property
- JavaScript | RegExp constructor
- JavaScript | Array prototype Constructor
- JavaScript | Math.LN2 property
- Javascript | MouseEvent which Property
- JavaScript | undefined Property
- JavaScript | Infinity Property
- JavaScript | global Property
- How to remove CSS property using JavaScript?
- JavaScript | Error name Property
- JavaScript | Math.PI Property
- JavaScript | Cursor property
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

