javscript for of loop code example
Example 1: javascript for of loop
(function() {
for (const argument of arguments) {
console.log(argument);
}
})(1, 2, 3);
// 1
// 2
// 3
Example 2: how to use for of in javascript
const array1 = ['a', 'b', 'c'];
for (const element of array1) {
console.log(element);
}