arr.forEach

// for each element call alert
["Bilbo", "Gandalf", "Nazgul"].forEach(alert);

The arr.forEach method allows to run a function for every element of the array.

Syntax

Arr.forEach(function(item, index, array) {
  // ... do something with item
});

Related concepts

arr.forEach

arr.forEach — Structure map

Clickable & Draggable!

arr.forEach — Related pages: