JavaScript forEach: Example of Applying Functions to All Elements