Array valueOf() Method - Javascript Array

Javascript examples for Array:valueOf

Description

The valueOf() method returns the itself.

Parameters

None

Return Value:

An Array. The valueOf() method returns itself

?fruits.valueOf() will return the same as fruits

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

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

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

<script>
function myFunction() {/*from   w w w .  j  av  a2 s. c  o m*/
    var fruits = ["a","b","c","d","e"];
    document.getElementById("demo").innerHTML = fruits.valueOf();
}
</script>

</body>
</html>

Related Tutorials