Earlier to ES6 nosotros had to purpose for loop or Array’s foreach loop to walkthrough elements of an collection. ES6 introduced a novel means for iteration.
Syntax
for (variable of array_or_object)
{
Statements;
}Example
var ar = [2, 4, 5, 2, 7, 48, 234];
for (i of ar)
{
alert(i);
} Example Program:- (Editor)
Editor is Loading...
Advertisement

Tidak ada komentar:
Posting Komentar