applies the callback to the elements of the given array