Compressed code by replacing the callOnEachElement() function with a split string + forEach loop.