---
title: "Discussion on \"JavaScript Design Patterns — Behavioral — Strategy\" | Hashnode"
description: "Discussion on \"JavaScript Design Patterns — Behavioral — Strategy\". The strategy pattern defines a family of algorithms, encapsulates each one, and makes them interchangeable.\nIn this example, We have a set of discounts that can be applied to a shopping cart. We can pass the function that we will apply to the constru..."
url: "https://hashnode.com/posts/javascript-design-patterns-behavioral-strategy/66bf1b480d366fea03dc6e2d"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [JavaScript Design Patterns — Behavioral — Strategy](https://nhannguyen.hashnode.dev/javascript-design-patterns-behavioral-strategy?utm_source=hashnode&utm_medium=feed)

The strategy pattern defines a family of algorithms, encapsulates each one, and makes them interchangeable. In this example, We have a set of discounts that can be applied to a shopping cart. We can pass the function that we will apply to the constru...

Aug 16, 2024 · 1 min read · nhannguyen.hashnode.dev  
Read the article

-   [#programming-blogs](https://hashnode.com/tag/programming-blogs)
-   [#javascript](https://hashnode.com/tag/javascript)
-   [#beginners](https://hashnode.com/tag/beginners)

## Written by

[Nhan Nguyen](https://hashnode.com/@hoainhaannguyen)

@hoainhaannguyen · Vietnam

  
[View profile](https://hashnode.com/@hoainhaannguyen)

Makes difficult things seem easy

I'm Nhan. I'm a web developer from Vietnam. I have over 5 years of experience in the Angular framework.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
