Personally I try to avoid JS constructors as `new` keyword behaviour is broken IMHO. Sure, there are ways to patch that, but should we do it over and over again?

Better to use `class` keyword, as it's universally supported part of ES2015 already. However classes come with its own set of confusion to Java and C# developers.

I've tried to explain the point in a post, so have a read, please :) https://levelup.gitconnected.com/oop-best-practices-that-are-anti-patterns-in-functional-javascript-61ee1af35452

--

--

--

Father. Husband. Solutions developer profesionally (software quite often). Arsenal supporter. Cyclist.

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

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
Adam Brodziak

Adam Brodziak

Father. Husband. Solutions developer profesionally (software quite often). Arsenal supporter. Cyclist.

More from Medium

#racialdiscrimination This article is part of a collection on the events of Jan.

What is Node.js & Why it is used

CS373 Spring 2022: Matthew Escobar Blog #14: Final Phase

CS 371p Spring 2022: Entry 10