gty3 years agoLevel 1ReplyReport SpamUse the forEach() function on the array: const fruits = ["apple", "orange", "cherry"]; fruits.forEach(myFunction); Like Reply
ekpono3 years agoLevel 12ReplyReport SpamYou can use foreach const array1 = ['a', 'b', 'c']; array1.forEach(element => console.log(element)); Check here for more details https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach Like Reply
Sinnbeck3 years agoLevel 102ReplyReport SpamI assume this is just a spammer. Complete duplicate of https://stackoverflow.com/questions/9329446/for-each-over-an-array-in-javascript Like Reply