DEV Community

Discussion on: ES6 for beginners with example

Collapse
 
srebalaji profile image
Srebalaji Thirumalai

Thank you. I updated :) :)

Collapse
 
reegodev profile image
Matteo Rigon

I'd like to point to the case of your get Name and set Name. Usually you keep those methods in lowercase to simulate an actual property so that who uses your class/object sees them as normal property retrieval/assignment.

@eerk example is perfect, since it is also good practice to name the actual property with the same name of the getter/setter methods prepended by an underscore