Array constructor Property - Javascript Array

Javascript examples for Array:constructor

Description

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

Return Value:

function Array() { [native code] }

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<button onclick="myFunction()">Test</button>

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

<script>
function myFunction() {// www  .j a v  a2 s. co  m
    var fruits = ["Banana", "Orange", "Apple", "Mango"];
    document.getElementById("demo").innerHTML = fruits.constructor;
}
</script>

</body>
</html>

Related Tutorials