Calls the given function for each element of an array.
forEach(callback, thisArg?)
callback function(value, index, array)
A function that accepts up to three arguments: the value of the current element, the index of the element, the original array. It is called one time for each element of the array.
thisArg optional
An object to which the this keyword is bound in the callback function. If omitted, undefined is used as the this value.
forEach is useful for performing side-effects with array elements.
To transform each array element, consider map.
new Int32Array([23, 42, 108]).forEach(x => print(x))
23
42
108