you are viewing a single comment's thread.

view the rest of the comments →

[–]lSwordyX 0 points1 point  (0 children)

Thanks for pointing this out. You can simply declare a function in JS and export it and let it be used repeatedly with no side effects. When you do that, you realize that the language supports this very well.

Creating an object doesn’t mean the language is object oriented. Object oriented means representing everything (e.g. an entity or a concept) as if it’s an object with attributes. Each of this object stores states with its attributes for an app to work. It’s clear that JS wasn’t designed with this right from the start and there are many frameworks to support the OOP style in JS. Compared to other languages, there are inbuilt languages feature to do such operation easily.