I agree with the side effects call out but I don’t believe using built in array functions are better from a long term perspective. They can be challenging to debug for the next code maintainer. Readability tends to be the better approach most of the time and a classic loop is a better alternative over some fancy built in method that can complex to interpret. Debugging in production at night is no fun!

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store