Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

foreach javascript

const names=["shirshak", "John","Amelia"]
//forEach is only for array and slower then for loop and for of loop 
//forEach we get function which cannot be break and continue as it is not inside 
//switch or loop.
names.forEach((name,index)=> {
console.log(name,index)//
})
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #foreach #javascript
ADD COMMENT
Topic
Name
2+1 =