Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

foreach js

const arr = ["some", "random", "words"]

arr.forEach((word) => {       // takes callback and returns undefined
	console.log(word)
})

/* will print:
   some
   random
   words    */ 
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #foreach #js
ADD COMMENT
Topic
Name
5+1 =