Consider the following code snippet. What will be the output?
class Person {
constructor(name) {
this.name = name;
}
toString() {
return `Person: ${this.name}`;
}
}
const person = new Person('John');
console.log(person);
Consider the following code snippet. What will be the output?
class Person {
constructor(name) {
this.name = name;
}
toString() {
return `Person: ${this.name}`;
}
}
const person = new Person('John');
console.log(person);