Is the following the correct way to retrieve properties that are defined in the prototype and those defined in the constructor?
function greet(name) {
this.name = name;
}
greet.prototype.new = "New"
greet.prototype.print = function() {console.log('Hi!', this.name)};
let o = Object.create(greet.prototype);
o.constructor("Bob")
console.log('Prototype props:', Object.keys(Object.getPrototypeOf(o)));
console.log('Constructor props:', Object.getOwnPropertyNames(o));
Additionally, is there a more straightforward way to grab the prototype properties than doing Object.keys(Object.getPrototypeOf(o)) ?