|
|
|
|
|
by mschuetz
2836 days ago
|
|
Nice list. Perhabs just personal preference but I'd use for(let element of someList){
console.log(element);
}
instead of someList.forEach(element => {
console.log(element)
})
for...of is easier to read and recognize as a loop construct at first glance, and as far as I recall it's also faster nowadays since the body of the loop is inline, whereas forEach requires the runtime to deal with a function object. |
|