Duck Typing in JavaScript ?
The term duck typing comes from the saying “If it looks like a duck, swims like a duck, and quacks like a duck, then it probably is a duck”.
Duck Typing helps to avoid conditional in JavaScript. Duck Typing helps to emulate interface interfaces in JavaScript.
References
- http://adripofjavascript.com/blog/drips/using-duck-typing-to-avoid-conditionals-in-javascript.html
- http://jscriptpatterns.blogspot.com/2013/01/javascript-interfaces.html
- https://en.wikipedia.org/wiki/Duck_typing
Categories :
JavaScript