[DOC release] Fix doc bug where forEach parameter order is wrong

Seems the code was updated to match ES6 but not the docs.
Merge pull request #9632 from thomassnielsen/patch-2

[DOC release] Fix doc bug where forEach parameter order is wrong