Earlier to ES6 we had to use for loop or Array’s foreach loop to walk through elements of an collection. ES6 introduced a new way for iteration.
The following example is help you 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

 
 
 
 
 
 
 
 
 
 
 
 
0 nhận xét:
Đăng nhận xét