Getters are accessed like properties , not like functions.
So:
cat.fullName; // " Fancy Whiskers "
No parentheses.
Why others are wrong:
A: cat.fullName() tries to call the returned string as a function.
B and C: These properties (get, function) do not exist; they are misinterpretations of syntax.
Contribute your Thoughts:
Chosen Answer:
This is a voting comment (?). You can switch to a simple comment. It is better to Upvote an existing comment if you don't have anything to add.
Submit