[Design Patterns in Javascript] Duck Typing in Javascript

Опубликовано: 19 Март 2026
на канале: Techmaker Studio
3,221
66

Duck typing isn't exactly a design pattern, but I stumbled over it while working through the Strategy Design Pattern in Javascript episode, and I decided it made sense to include it here.

Duck typing is essentially a method that takes advantage of being able to substitute one object for another in a dynamic language if it has the same API.

If it walks like a duck and quacks like a duck, it must be a duck... or something like that.

Want to move out of the beginner and intermediate programming levels into being more advanced? One of the things that will help get you there is learning design patterns.

This is the fourth episode in a new series we are doing on design patterns in javascript.

We are putting out 2+ videos per day, so subscribe to our channel if you want to seriously level up your development game. 👊 Helpful Links 👊

Free E-book:
Power Portfolio - How to stand out... even if you're just getting started: https://bit.ly/2ylvdcb

Building a Messenger app in Rails 6:    • Rails Tutorial | Building a Real Messenger...  

Action Cable Basics in Rails 6:    • Rails Tutorial | Action Cable Basics in Ra...  

Building a Link Shortener with Rails 6 (playlist):    • Building a Link Shortener with Rails 6 | R...  

Building a Stock Market Tracker with React JS (playlist):    • React JS Project from Scratch: Build a Sto...