Open this example in the interactive library
Source code
interface Named {
name: string;
}
console.log(
(() => {
class Base {
protected label() {
return "base";
}
}
class Child extends Base {
read() {
return this.label();
}
}
return new Child().read();
})(),
);
Sample output
base
