What will the following code print?
class Father {
constructor() {
this.name = 'Father';
}
}
class Son extends Father {
constructor() {
super();
this.name = 'Son';
}
}
const son = new Son();
console.log(son.name);
What will the following code print?
class Father {
constructor() {
this.name = 'Father';
}
}
class Son extends Father {
constructor() {
super();
this.name = 'Son';
}
}
const son = new Son();
console.log(son.name);