When do you ever need to create classes when doing front-end (javascript)?

I’ve been doing front-end development for about 3+ years now using the React framework. Besides the component classes in React, I’ve never had the need to use classes to create other objects.

The reason is almost all object arrays that need to be rendered come from the backend (and hence are created server-side). Even the creation of new instances of an object / data is done via a POST request.

Anyone have had the need to create classes other than to create components when doing front-end? If so, in what scenarios?

I work in a very large Angular application and I use classes pretty often.

1 Like

In a true object oriented approach, everything is an object, not just the obvious stuff (like elements on a screen). For example, on the drum machine I am currently working on I needed an internal timing mechanism for looping over the drum tracks, so I created a class to do that.

1 Like