NodeJS patterns — The decorator pattern

  • name is the name of the instance
  • account is the amount of money owed by the instance
  • items is an array with objects bought by the instance

Now is the interesting part.

Conclusion

--

--

--

Full Stack Web Developer | antonzaharia.com

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

What’s new in JavaScript/Node in 2021 | ECMAScript 2021

Add Custom Font in React Native

Routing and Code Splitting in React

Understanding Post-Mutation Data Updates in Apollo

~/ tilde paths with eslint, typescript, and webpack

How I wrote my first E2E Test with JS.

How to Implement AWS X-Ray Tracing

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Zaharia Anton

Zaharia Anton

Full Stack Web Developer | antonzaharia.com

More from Medium

How to Install KeyCloak 17 on Windows Machine

Setting up a node project in typescript from Scratch

Application Frameworks

How to store long lat point on Postgre with Express Js and Sequelize