Where to Define Getter Methods in JavaScript


The hint and the help video say to define the getters and setters for the properties outside of the object where they’re defined:

const menu = {
  _courses: {
    appetizers: [],
  get appetizers() {

That doesn’t make sense. Shouldn’t they be in the same object of the properties they’re for?