In TypeScript, a class can be defined as shown below:
class Sup {
static member: any;
static log() {
console.log('sup');
}
}
If you write the following code:
let x = Sup;
Why does the type of x
show up as typeof Sup
(highlighted in vscode) and what does typeof Sup
mean? Is it related to the typeof
operator?
Moreover, how would you type something like let y = Object.create(Sup)
?
Is it correctly typed as
let y: typeof Sup = Object.create(Sup)
?