{
class Parent {
constructor(name = 'c1') {
this.name = name;
}
}
let v_parent = new Parent('v');
console.log(v_parent);
} {
class Parent {
constructor(name = 'c2') {
this.name = name;
}
}
class Child extends Parent {
constructor(name = 'child') {
super(name);
this.type = 'child';
}
}
console.log(new Child());
} {
class Parent {
constructor(name = 'c2') {
this.name = name;
};
get longName() {
return 'mk' + this.name;
}
set longName(value){
this.name = value;
}
}
let p = new Parent();
console.log(p.longName);
p.longName = 'hello';
console.log(p.longName);
}
console