There is a fairly new method which has been added to the Array object in JavaScript. It is known as the forEach( ) method.
It will call a function once for each element in the array. The function will have direct access to the array element, the index number, and the entire array.