Answers for "enhanced for loop in javascript"

220

javascript for loop

var colors=["red","blue","green"];
for (let i = 0; i < colors.length; i++) { 
  console.log(colors[i]);
}
Posted by: Guest on June-17-2019
8

for loop javascript

var listItem = [
        {name: 'myName1', gender: 'male'},
        {name: 'myName2', gender: 'female'},
        {name: 'myName3', gender: 'male'},
        {name: 'myName4', gender: 'female'},
      ]

    for (const iterator of listItem) {
        console.log(iterator.name+ ' and '+ iterator.gender);
    }
Posted by: Guest on May-09-2020
2

javascript for loop[

for(i=0;i<=5;i++){
  console.log(i);}
Posted by: Guest on June-12-2020
0

enhanced for-loop,

for (String element : array) {    System.out.println("Element: " + element);}
Posted by: Guest on October-12-2020
-1

enhanced for-loop,

for (int i=0; i < array.length; i++) {    System.out.println("Element: " + array[i]);}
Posted by: Guest on October-12-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language