ES6 - String Property Constructor


Advertisements

A constructor returns a reference to the string function that created the instance's prototype.

Syntax

string.constructor

Return Value

Returns the function that created this object’s instance.

Example : String constructor property

var str = new String( "This is string" ); 
console.log("str.constructor is:" + str.constructor)

Output

str.constructor is:function String() { [native code] }
es6_strings.htm
Advertisements