JavaScript String constructor property

Definition and usage

constructor properties return the function that creates the string prototype.

For JavaScript strings, the constructor returns:

function String() { [native code] }

instance

Get the string constructor:

let message = "Hello World!";
let text = message.constructor;

try it yourself

grammar

string.constructor

return value

function String() { [native code] }

browser support

constructor wani akwai ES1 (ES1) harsa.

Dallan ba ce girmi ayyan ES1 (JavaScript 1997):

Chrome IE Edge Firefox Safari Opera
Chrome IE Edge Firefox Safari Opera
Gudanarwa Gudanarwa Gudanarwa Gudanarwa Gudanarwa Gudanarwa

Shirin yana da alama

JavaScript marubutu

Rafinawa JavaScript marubutu

JavaScript marubutu rannu