Avatar of Software Squirrel
Software Squirrel
Flag for United States of America

asked on 

Identify JavaScript Element

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?
JavaScript

Avatar of undefined
Last Comment
Julian Hansen

8/22/2022 - Mon