Understanding for…of Loop in Javascript


Iterate over iterable objects (including arrays, strings) with for…of.

Source Code

let fruits = ['apple', 'banana', 'cherry'];
for (let fruit of fruits) {
  console.log(fruit);
}
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments