String constructor Property - Javascript String

Javascript examples for String:constructor

Description

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

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<p id="demo"></p>

<script>
var str = "Hello World!";
document.getElementById("demo").innerHTML = str.constructor;
</script>//  w  ww . j  ava  2  s  .  c o m

</body>
</html>

Related Tutorials