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    */ 
 
PREVIOUS NEXT
Tagged: #foreach #js
ADD COMMENT
Topic
Name
6+9 =