Skip to content
Related Articles

Related Articles

JavaScript Number constructor Property

View Discussion
Improve Article
Save Article
  • Last Updated : 13 Sep, 2021

Below is the example of the Number constructor property. 

  • Example: 


<!DOCTYPE html>
<body style="text-align:center;">
        Welcome to GeeksforGeeks
        Click the button to see number
        constructor property.
    <button onclick="myGeeks()">
        click me
    <p id="GFG" style="font-size:20px;" ></p>
    <!--Script to use Number constructor property-->
        function myGeeks() {
            var num = 420;
                    = num.constructor;

  • Output: 
    • Before Clicking On Button: 

  • After Clicking On Button: 

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.


Return Value: This function returns the Number() { [native code].
More example codes for the above property are as follows: 
Program 1: 


    var num = 444;


function Number() { [native code] }

Program 1: 


    var num = 44.44;


function Number() { [native code] }

Supported Browsers: 

  • Google Chrome 6.0 and above
  • Internet Explorer 9.0 and above
  • Mozilla 4.0 and above
  • Opera 11.1 and above
  • Safari 5.0 and above


My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!