function Person(name) {
this.name = name;
}
Person.prototype.greet = function () {
console.log(`Hello, ${this.name}`);
};
const person = new Person('Alice');
person.greet();
console.log(person.hasOwnProperty('greet'));
Post #1777
6.43K
CHALLENGE
- 👍 7