[Design Patterns in Javascript] Duck Typing in Javascript

4 years ago
1

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: https://www.youtube.com/watch?v=s3CmHhDjuWc&t=18s

Action Cable Basics in Rails 6: https://youtu.be/t9iubpbqmnM

Building a Link Shortener with Rails 6 (playlist): https://www.youtube.com/playlist?list=PLjItgYqIzJ9WGy9WMf-44DXHB_7aWwJMc

Building a Stock Market Tracker with React JS (playlist): https://www.youtube.com/playlist?list=PLjItgYqIzJ9VOBgwZ82D9kjQ_QtM5R4u5

Loading comments...