Interfaces

Interface is a skeleton something should conform to. In general, interfaces are skeletons for classes. But need to explicitly mention that class implements the interface. Whether the class conforms to the interface is checked at compile-time. But since, in JavaScript almost everything is an object. Interface is a skeleton for an object. Since class is also an object, and everything is covered. Unlike in other languages, interface can be used with any object at the compile-time, and checked if it conforms with the interface.

Adesh Tamrakar
SOFTWARE ENGINEER · VAULT

Notes, insights and random discoveries from a working engineer's vault - written for future me, published for you.