loading...

re: Symbols in ES6 - A Quick Guide VIEW POST

FULL DISCUSSION
 

Nice article, but I think there is a typo.

const foo = {
name: 'Ben',
age: 25,

}

for(let val of foo) {
console.log(val) // Ben, 25
}

This should throw TypeError, because objects are not iterable. Maybe you meant for...in ?

 
for(let val of Object.entries(foo)) {
    console.log(val) // ['name','Ben'], ['age',25]
}

developer.mozilla.org/en-US/docs/W...

code of conduct - report abuse