Duck Typing is a common practice in many OOP languages. It got its name from the so-called “Duck Test’, that is: If it looks like a duck, swims like a Duck, and quacks like a ducks, then it probably is a duck. In TypeScript, Duck can and will be a type.

4m read timeFrom javascript.plainenglish.io
Post cover image
Table of contents
What is “Duck Typing”?Why Duck Type?Example Use Case: recursiveResolveBonus: Predicate Libraries
1 Impression3 Comments