fullName
property on the Person
class is defined as a method. But, we could define it as a property based on the firstName
and lastName
property. computed()
method, and passing it an initialization hash. The should have a getter method, and an optional setter method. Let's see how we can redefine our Person
class using computed properties.computed()
method to define computed property on the class definition.set
method on its computed property definition.fullName
property, it will not change.MINIMUM_AGE
on the Person
class.enumerable
property to the computed property descriptor.configurable
property on the property descriptor.