How to write Interfaces and Implementations in Javascript?

39 Views Asked by At

Can i use static for implementations? What is the best way to write classes with Interfaces and Implementations in Javascript?

Thank you.

1

There are 1 best solutions below

0
Jonas Wilms On

js has not class inheritance it has prototypal inheritance. And more importantly js is weakly typed so theres no real need for interfaces. If you however want to make assertions, you may use TypeScript or your own small script that does so.