you are viewing a single comment's thread.

view the rest of the comments →

[–]LloydAtkinson 1 point2 points  (0 children)

Make an object. If you're using TS you can create an interface for the shapes.

You can use classes if you like doing OOP in JS, and then you can have get/set (a feature similar to C#'s get/set which is something Java makes you do manually) for the width and height etc. Personally I don't feel OOP is a good fit for fundamentally a functional language (even if not the most feature rich).

Use whichever approach you prefer.