Use the length property to display the number of array items in myArray. - Javascript Array

Javascript examples for Array:Quiz

Description

Use the length property to display the number of array items in myArray.

Demo Code

ResultView the demo in separate window

 <!DOCTYPE html>
<html>
<body>

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

<script>
var myArray = ["CSS", "HTML", "Javascript"];
document.getElementById("demo").innerHTML = myArray.length;
</script>//w  ww .j  a v a  2 s  .c  o m

</body>
</html>

Related Tutorials