Skip to content
Advertisement

Syntax for extends or implements a plain object

I have this:

JavaScript

this syntax doesn’t seem to work. I also tried:

JavaScript

but that’s no bueno either, do I really need to use a class or interface, is there not a way to do it inline?

Advertisement

Answer

Whoops that was dumb, just put the extends on the wrong generic parameter, this is fine:

JavaScript

and so is this:

JavaScript
Advertisement