Add Delete Find Filter ForEach IndexOf Map Chain Functions BrowserStorage Promise Back
Logo image

Loop Elements In Array of Objects


Suppose you want to change the element of a person's name.

You can loop object array & use Array.forEach to search and replace.


Copy the code below & save file as object.html:



Explaination:

Without manually having to loop the array, forEach stores the properties in (element, index) so we can easily access the objects.