.forEach() (JavaScript)

.forEach() runs a function once for every element in an array. It is used to perform an action for each item, not to build a new array.

Welcome to LearnCodingFast — free, interactive programming lessons covering Python, JavaScript, Java, C++, C#, SQL, HTML/CSS, React, AI and more. Every course is hands-on with examples you can run in your browser.

Loading interactive version…