The for...of loop is used to iterate over the values of an iterable object such as arrays, strings, and collections. On the other hand, the for...in loop is used to iterate over the keys or indices of an object.
In summary, for ... of loop loops through the values of an iterable object, while for ... in loop loops through the keys or indices of an object.
const arr = ['a', 'b', 'c'];
for (const value of arr) {
console.log(value);
}
for (const index in arr) {
console.log(index);
}