mirror of
https://github.com/alrayyes/wiki.git
synced 2024-11-25 04:56:23 +00:00
333 B
333 B
date | id | title |
---|---|---|
2020-10-30 | 88c7d978-30a1-4908-bbd8-3263fb6c1d44 | JavaScript For Of |
Syntax
const arr = ['a', 'b', 'c'];
for (const elem of arr) {
console.log(elem);
}
const arr = ["a", "b", "c"];
for (const [index, elem] of arr.entries()) {
console.log(index + ". " + elem);
}