Could someone give me an example of Duck Typing inheritance in Javascript? I’m exploring OO javascript and I’ve heard about duck typing but can’t see any examples of it being used in javascript.
Could someone give me an example of Duck Typing inheritance in Javascript? I’m exploring
Share
The second link gives an example of a duck-typing-like pattern in js. Not saying I recommend doing this, but… well, you asked for it. 😉
Wikipedia – Duck typing
JavaScript Interfaces and Duck Typing