I'm learning Javascript and has a simple question.
var friends = [
{name:'John', age:51},
{name:'Bill', age:20},
{name:'Mary', age:29}
];
persons.forEach(function(a, b, c) {
var currentElem = XXX;
});
Open in new window
What would you write instead of XXX to get the current element of the array, while iterating on the elements of the array?