Array iterate
In this chapter you will learn:
Enumerating the Contents of an Array
You can enumerate the content of an array using a for loop.
<!DOCTYPE HTML><!-- j av a 2s . c o m-->
<html>
<body>
<script type="text/javascript">
var myArray = [ 100, "Adam", true ];
for ( var i = 0; i < myArray.length; i++) {
document.writeln("Index " + i + ": " + myArray[i]);
}
</script>
</body>
</html>
Next chapter...
What you will learn in the next chapter:
Home » Javascript Tutorial » Array