Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js for each item in array

const array1 = ['a', 'b', 'c'];

array1.forEach(element => console.log(element));

// expected output: "a"
// expected output: "b"
// expected output: "c"
Source by www.codecademy.com #
 
PREVIOUS NEXT
Tagged: #js #item #array
ADD COMMENT
Topic
Name
7+7 =