Thanks mate. You should use element.offsetTop instead of having a set number (e.g 800) in your target in your example. Would've been clearer.
It's really stupid that you can use forEach on a result from querySelectorAll. Thanks for the tip tho, it helped me.