Consider the following code snippet. What will be the output?
class Person {
constructor(name) {
this.name = name;
}
sayHello() {
console.log(`Hello, ${this.name}!`);
}
}
class Student extends Person {
constructor(name, grade) {
super(name);
this.grade = grade;
}
sayHello() {
super.sayHello();
console.log(`I am in grade ${this.grade}.`);
}
}
const student = new Student('John', 8);
student.sayHello();