What happens when you execute this code?
class Person {
constructor(name) {
this.name = name;
}
greet() {
return `Hello, I am ${this.name}`;
}
}
const ana = new Person('Ana');
console.log(ana.greet());
What happens when you execute this code?
class Person {
constructor(name) {
this.name = name;
}
greet() {
return `Hello, I am ${this.name}`;
}
}
const ana = new Person('Ana');
console.log(ana.greet());