
# Week 06 Task 02: Strategy and Adapter Patterns in JavaScript
In Week 06 Task 02, I continued learning Design Patterns in JavaScript. For this task, I implemented two important design patterns: The goal was to understand how design patterns can help make code more flexible, reusable, and easier to maintain. I also created tests using Node.js's built-in assert module to verify that the implementations worked correctly. What is the Strategy Pattern? The Strategy Pattern allows us to define multiple ways of performing an operation and choose between them at runtime. Instead of putting all the logic inside one large if-else or switch statement, we create separate strategies. For example, an online shopping application may have different discount rules: Each strategy handles its own discount calculation. I created three discount strategies: This strategy returns the original price.

