Tutorials Examples

Drakon.Tech JavaScript tutorial: how to iterate over an array

How to build a loop that iterates over a JavaScript array.

  1. Add a "For loop" icon.
  2. Inside the loop start icon, put the loop variable, semicolon, and then the collection.

Example:

item; items

Iterating a JavaScript array with a For loop icon:

Iterating a JavaScript array with a For loop icon

Note:

An alternative format for a low-level loop:

i = 0; i < items.length; i++

A low-level "For loop" icon:

A low-level For loop icon