Please help me understand objects, this keyword, setters & getters

I am trying to practice objects and so far this code is what I have. logging the callback for the getter comes back undefined.

can someone explain or help ?

let whatever={
  _firstName:'bob',
  _lastName:'smith',
  memberName(){
    if (this._firstName && this._lastName){
      return `${this.firstName} ${this.lastName}`;
    } else {
      return 'missing value';
    }
  },
  _age:25,
  get age(){
if (this._age){
      return _age;
    }else {
      return 'missing value';
    }
    },
  set age(newAge){
    if (typeof newAge === 'number'){
      this.age=newAge;
    }else {
      return 'missing value';
    }
    },
  };

console.log(whatever._memberName);

console.log(whatever._age)
whatever._age=27
console.log(whatever._age);

You have to call the method memberName with parenthesis, plus no underscore before the method is needed.

console.log(whatever.memberName());

I forgot to say the getter for _age is working for me for both values 25 and 27.

i changed it and it’s still giving me undefines

let whatever={
  _firstName:'bob',
  _lastName:'smith',
  memberName(){
    if (this._firstName && this._lastName){
      return `${this.firstName} ${this.lastName}`;
    } else {
      return 'missing value';
    }
  },
  _age:25,
  get age(){
if (this._age){
      return _age;
    }else {
      return 'missing value';
    }
    },
  set age(newAge){
    if (typeof newAge === 'number'){
      this.age=newAge;
    }else {
      return 'missing value';
    }
    },
  };
console.log(whatever.memberName());

console.log(whatever._age)
whatever._age=27
console.log(whatever._age);

You forgot the underscores _firstname

${this._firstName} ${this._lastName}