var persons = [
{name:'Michel', age:51},
{name:'Henri', age:20},
{name:'Francois', age:29}
];
for(var i = 0; i < persons.length; i++) {
var p = persons[i]; // current element
document.body.innerHTML += p.name + "<br>";
}
JS.Basics.Arrays.IterateOverArray.ForLoop.js
--------------------------------------------
A [Pen](https://codepen.io/Onlyforbopi/pen/wEbzOO) by [Pan Doul](https://codepen.io/Onlyforbopi) on [CodePen](https://codepen.io).
[License](https://codepen.io/Onlyforbopi/pen/wEbzOO/license).
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Draw a monster in a canvas</title>
</head>
<body>
<p>
<b>These names, ages and indexes have been generated dynamically
by iterating on an array using a <code>for</code> loop.</b>
</p>
</body>
</html>