[Solved] Is the best way to reference these object properties?


If you only want to assign myId1 to the default value of Class().Id1, and the same with 2, then you can do it your second way.

However, if you want to be assigning those two variables to the values of a manipulated Class object, then do it the first way.

Instantiating a whole new object just to get a second default value is wasteful.

1

solved Is the best way to reference these object properties?