Hey guys, I’m still having trouble with my setters.
I wrote and ran the program without a hitch and have also done my getters correctly, but now I’m stumped as to how we are meant to be using the setters.
if set appetizers(appetizerIn) { this._courses.appetizers = appetizerIn; }
is the correct implementation, I have two issues.
-
That looks to me like it will reassign a new value to the appetizers array rather than adding it to the array with .push(). Am I wrong here?
-
How do we then assign new appetizers? Setters only accept one parameter, so do I need to build an appetizer object and use that as the argument when calling the setter method?
Thank you.