I can't really understand the console.log last output.
It prints:
constructor - ƒ Array() { [native code] }
speak - undefined
undefined
1) Why is speak - undefined? 2) Why there is the third output line - just - undefined? Where does it get from?
class Bar {
speak() {
let text = 'test';
alert(text);
return text;
}
}
var test = new Bar;
z = Object.getOwnPropertyNames(Object.getPrototypeOf(test));
console.log(typeof z, " - ", z);
console.log(z.forEach(function(e) { console.log(e, " - ", z[e]); }));
Please help. Thank you!