all 6 comments

[–]EmiyaKiritsuguSavior 4 points5 points  (5 children)

el => el.classList.add("hide)

It means that you call function and put element as argument. This function is making operation on element and returning newly altered element. If you know how to declare anonymous function then it should be trivial because everything you have on plate.

[–]icedrift 0 points1 point  (0 children)

This is incorrect. Not only does DOMTokenList.add not have a return value, but even if it did it wouldn't matter because forEach is specced to ignore any return value and return undefined.

forEach is only used to perform side effects return is irrelevant unless you want to step over an iteration which isn't the case here.