Answers for "how does for in for loops works"

220

for in javascript

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

for loop

// ordinary for loop
let str = "Buzz";
for (let i = 0; i < str.length; i++) {
  console.log(str[i]);
}
Posted by: Guest on October-12-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language