Earlier to ES6 nosotros had to purpose for loop or Array’s foreach loop to walk through elements of an collection. ES6 introduced a novel agency for iteration.
The next representative is aid you lot to read all the value from objects.
Syntax
for (variable of array_or_object)
{
Statements;
}
Example
for(i of ar_ob)
{
debugger;
alert("Name : "+i.name);
alert("Mark : "+i.mark);
}
Example Program:- (Editor)
Editor is Loading...
Advertisement
Tidak ada komentar:
Posting Komentar