One of the greatest additions to the javascrcipt ecosystem has been the addition of
typescript. one important part that was introduced in typescript
was the ability to define
interface. simply put an interface is a way to define a structural contract to the consumer of a particular
code or more generally interface is a group of related properties and methods that
describe an object.
Now to create an object that confirms with the defination of Point inteface , we can write.
Now assume there is a consumer of this Point object which always expects the object passed to it always has a
y property defined.
If we now by mistake make a call to
draw method like this