This function is from my 2nd studio from 157a. It is part of a larger function that helps reset the variables as the image scale and repositions itself on scroll.
posts.forEach(function(post) {
postTops.push(Math.floor(post.getBoundingClientRect().top) + window.pageYOffset);
});
const posts.forEach = function(post) {
postTops.push(Math.floor(post.getBoundingClientRect().top) + window.pageYOffset);
};
posts.forEach( post => {
postTops.push(Math.floor(post.getBoundingClientRect().top) + window.pageYOffset);
});