DEV Community


Discussion on: I Don't Use JavaScript Classes At All. Am I Missing Out on Something?

leviathanprogramming profile image
𝐋𝐄𝑽𝐈𝑨𝐓𝐇𝐀𝐍 Programming

I don't really use JS classes either. I use OOP by making a constructor with a function.

function Unit(stats){
  this.stats = stats;
}; = function(){
Enter fullscreen mode Exit fullscreen mode
shadowtime2000 profile image

This is probably worse because it adds an unnecessary amount of code and is harder to understand at the start, especially with large classes.