@jeea yes, that is a perfect usage here, I think. It's called
a factory method. In a lot of cases, you want to make the constructor private, so you can't call it from the outside but I can't remember off the top of my head if that's possible in JS yet. There was a proposal for sure, not sure if it's in yet
and implemented in the engines.