I have the following code, much reduced:
class Animal {
speak() {}
}
Animal.prototype.speaklouder = function() {};
for (const key in new Animal()) {
console.log("key", key);
}
This produces, in node 6.11.0,
key speaklouder
Why is that? I thought the class syntax is just sugar? I would expect the function speak to be also listed as an attribute.