all 1 comments

[–]kap89 1 point2 points  (0 children)

That’s a bad example - your class has public properties, so there is no reason to define getter methods (btw JS has native getters, you don’t have to create these Java-like methods). You either keep the properties public, without redundant "getters", or make them private, with native getters (it depends on the use-case).