How does interfaces with construct signatures work?

Posted by Editorial Staff | Updated on

In this example, we have shared how does interfaces with construct signatures work? Construct signatures in interfaces are not implementable in classes; they’re only for defining existing JS APIs that define a ‘new’-able function. Here’s an example involving interfaces new signatures that does work:

This creates an actual constraint for what you can invoke makeObj with:


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers