Example of for-of block in Javascript ES6

Posted in Tutorials

Tweet This Share on Facebook Bookmark on Delicious Digg this Submit to Reddit

While in previous tutorials, we used the forEach method to iterate through all the elements of an array; now we can use the for-of construct like this …

example of for-of construct

And you get the results as expected.

More ES6 features here.