Glossary: Software Design Patterns in JavaScript
Duck typing
Using any object that has the methods you need, whatever its class. applyDiscount works with any rule that has applies and apply.
Glossary: Software Design Patterns in JavaScript
Using any object that has the methods you need, whatever its class. applyDiscount works with any rule that has applies and apply.