9951 explained code solutions for 126 technologies


javascriptIterate an array (foreach)


[1, 2, 3].forEach(function(el) { console.log(el); });ctrl + c
[1, 2, 3]

array to iterate

forEach

this function will call argument callback for each array element

console.log(el)

replace with your code operating with el which will contain value of each array element