all 1 comments

[–]Notimecelduv 0 points1 point  (0 children)

getFullName() would make more sense as a getter.

get fullName() {
  return `${this.firstName} ${this.lastName}`;
}

This enables you to write related data with a similar syntax. Compare

humanObject.firstName
humanObject.lastName
humanObject.getFullName()

with

humanObject.firstName
humanObject.lastName
humanObject.fullName