What is Nostr?
Bart Louwers /
npub1wzx…l97v
2024-08-28 19:39:04
in reply to nevent1q…8vke

Bart Louwers on Nostr: I don't understand. ```js class Base { bla() { console.log("base"); } }; class ...

I don't understand.

```js
class Base {
bla() {
console.log("base");
}
};

class Derived extends Base {
bla() {
console.log("derived");
}
};

/**
* @template {Base} T
* @param {T} base
*/
function fun(base) {
base.bla();
}

fun(new Base());
fun(new Derived());

/**
*
* @param {typeof Base} cls
*/
function makeBase(cls) {
return new cls();
}

makeBase(Base).bla();
makeBase(Derived).bla();
```
Author Public Key
npub1wzxzrpd6hfpp7q8umdnhavfgwjke43ump2tdvd57w5zn2vreewcqapl97v