Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript foreach

var array = ["a","b","c"];
// example 1
  for(var value of array){
    console.log(value);
    value += 1;
  }

// example 2
  array.forEach((item, index)=>{
    console.log(index, item)
  })
 
PREVIOUS NEXT
Tagged: #javascript #foreach
ADD COMMENT
Topic
Name
2+4 =