Setters and getters are object properties that call a function when they are set/gotten.
Defining a Setter/Getter Using Object.defineProperty
Defining an Setter/Getter in a Newly Created Object
Accessing the date.date property would return the value 2017-02-27. Setting date.date = '2018-01-02 would call
the setter function, which would then parse the string and set date.year = '2018', date.month = '01', and
date.day = '02'. Trying to pass an incorrectly formatted string (such as "hello") would throw an error.
Defining getters and setters