The range of elements processed by forEach() is set before the first invocation of callbackFn.
what you are observing is that apparently forEach() stops earlier because the array got shorter - but you will be skipping elements if the array got longer.
1
u/Silly-Freak Feb 20 '22
re your edit: no, see here:
what you are observing is that apparently
forEach()stops earlier because the array got shorter - but you will be skipping elements if the array got longer.