Exploring various language constructs in Typescript, I am delving into creating an array of classes for later instantiation. Despite the code compiling and functioning correctly on the Typescript Playground, but it throws an error in the TypeScript editor:
Argument of type 'typeof Greeter' is not assignable to parameter of type 'BaseGreeter'.
Seemingly, this issue arises because the array definition anticipates instances of classes that extend BaseGreeter rather than the extending classes themselves. Is my assumption correct? If so, what would be the ideal way to define an array of classes extending BaseGreeter?
Beneath is the script:
(insert rewritten code here)...