

callbackFn will not visit any elements added beyond the array’s initial length when the call to forEach() began.Note, however, that the length of the array is saved before the first invocation of callbackFn. Unlike map(), forEach() always returns undefined and is not chainable.įorEach() does not mutate the array on which it is called, but the function provided as callbackFn can. It calls a provided callbackFn function once for each element in an array in ascending-index order.


The forEach() method is an iterative method.
