1. Home
  2. Javascript
  3. For of loop

Similar to for loop but you don't need to specify the number of iterations. The loop uses an iterator function built in to arrays.

#javascript#loop
var arr = [blue, green, yellow]

for (var color of arr) {
    console.log("The color is " + color);
}
copy
Full Javascript cheatsheet