nodejs loop over array

Learn to use arrays in nodejs

First let’s create a very simple array:

Now we’ve got an array with the three fruits, yummy!

Next, we’ll simply loop over them and print them out to the console.

You can work right from github using:


Let’s step it up a bit and work with a multi-dimensional¬†¬†array in nodejs:

Run this and you should get:

You can work with the code right now in jsfiddle: