To use the isPrototypeOf
function from the Underscore library in TypeScript, you need to include the Underscore type definitions in your project.
41 chars2 lines
isPrototypeOf
function from Underscore and use it in your TypeScript code, like so:index.ts349 chars19 lines
In this example, we have defined an interface MyInterface
and a class MyClass
that implements this interface. We then create an instance of MyClass
and check if MyInterface
is a prototype of this object using the isPrototypeOf
function.
Note that we pass in the constructor function MyInterface
as the first argument to isPrototypeOf
, followed by the object we want to check (myObj
) as the second argument.
I hope that helps!
gistlibby LogSnag