Stopped reading at this:
> for (let index in allImgs)
After all it looks like an article that mixes old and well know hacks (like short circuiting) with new ES6 syntax tricks.
But some completely miss the point: if we do the "longhand" version, maybe there's a reason. That's why I stopped declaring n variables all in one var statement, for example.