When do you need to create a custom object in js

Junior front-end advice, I usually create built-in objects such as Date,Array through new in js. It is rare to create custom objects through constructors. Under what circumstances is it better to use custom objects?

Mar.19,2021

when you need to use a constructor, it's usually time to reuse code.
for example, you have two sections on a page that use paging, so it's impossible to copy and paste, is it?
We can write a constructor to reuse

  

js will be used if you write too much, such as encapsulating your own method library component framework

Menu