how to create an effective link — that we can rely on
JavaScript does not have static types. What you’re asking for does not exist in the language. Therefore there is no way to do a static type check that you can rely on in JavaScript. That’s why instanceof lies and can be the source of lots of bugs or awkward restrictions. Nominal types (type checking based on the name or identity of a single class/interface) will never work well in JavaScript.
That’s why TypeScript (which adds static annotations and analysis on top of JavaScript) uses structural types, which is basically automated duck typing. You get essentially the same benefits, but without relying on static links.
Essentially, you do feature detection — just ensure the object in question has the properties and methods (the correct shape) required for your function to work.
