Add function forEach() for iterations that may be interrupted by callback