Hello,
I was wondering if it is best practice to have return statements at the end of class methods. For example, in the code below I am writing a method for the Nurse class which adds a new certification to the Nurse instance’s certification array. Do I need to add a return statement to the addCertification
method or no? The code seems to work fine without a return statement.
addCertification(newCertification) {
this._certifications.push(newCertification);
}
or
addCertification(newCertification) {
this._certifications.push(newCertification);
return;
}