For..of loop in JavaScript
For..of loop in JavaScript
In this article we are goanna to see about what is nested for loop and where we use these. which is most important when you are going to start your career in JavaScript. Please read and enjoy this article if you want to give any feedback about your experience, we welcome.
The for..of statement loops through the values of an iterable objects.
For..of lets you loop over data structures that are iterable such as Arrays, Strings, Maps etc.
Syntax:
for(var variable_name of array)
{
block of statements;
}
Example:
var cars = ["BMW", "Volvo", "Mini"];
for (var x of cars)
{
document.write(x + "<br >");
}
Tags:
JavaScript
0 comments
Please leave your comments...... Thanks