Javascript - Number constructor Property

In JavaScript, the constructor property returns the constructor function for an object.

Description

In JavaScript, the constructor property returns the constructor function for an object.

The return value is a reference to the function, not the name of the function:

For JavaScript numbers the constructor property returns function Number() { [native code] }

Syntax

number.constructor

Return

function Number() { [native code] }

Example

The constructor property returns a number's constructor function:

Demo

var num = 1.5;
console.log(num.constructor);

Result