let obj = {a:'a',b:'b'};
for (let p in obj){
console.log(p);
}
Output:
a
b
undefined
What's up with the undefined property?
let obj = {a:'a',b:'b'};
for (let p in obj){
console.log(p);
}
Output:
a
b
undefined
What's up with the undefined property?
That's not a property, it's the return of function that developer tools prints.
Example: