DEV Community

Discussion on: 🎯 JS Interview Checklist - Part 1 (Basics)

Collapse
rajatetc profile image
Rajat Gupta Author

Basically, the callback passed inside the forEach method is performing operations on the existing array and not forEach itself. forEach returns undefined. You can read more here: freecodecamp.org/news/4-main-diffe...