Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

forEach()

const colors = ['green', 'yellow', 'blue'];
colors.forEach((item, index) => console.log(index, item));
// returns the index and the every item in the array
// 0 "green"
// 1 "yellow"
// 2 "blue"
Source by www.freecodecamp.org #
 
PREVIOUS NEXT
Tagged:
ADD COMMENT
Topic
Name
7+3 =