JavaScript String constructor Property

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP







<!--
main_leaderboard, all: [728,90][970,90][320,50][468,60]
-->



JavaScript String constructor Property


❮ JavaScript String Reference




Example


The constructor property returns the string's constructor function:



var str = "Hello World!";

<!--

The constructor property returns:



function String() [native code]
-->
Try it Yourself »


Definition and Usage


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]


For JavaScript strings the constructor property returns
function String() [native code]


For JavaScript booleans the constructor property returns
function Boolean() [native code]



Browser Support














Property
constructor Yes Yes Yes Yes Yes

Syntax



string.constructor


Technical Details






Return Value: function String() [native code]
JavaScript Version: 1.1


❮ JavaScript String Reference

Popular posts from this blog

Malaysia to Papua New Guinea by motorcycle?

.name

List of Bhojpuri films