0 votes
in JavaScript by
What are the advantages of Getters and Setters?

1 Answer

0 votes
by

Below are the list of benefits of Getters and Setters,

  1. They provide simpler syntax
  2. They are used for defining computed properties, or accessors in JS.
  3. Useful to provide equivalence relation between properties and methods
  4. They can provide better data quality
  5. Useful for doing things behind the scenes with the encapsulated logic.
...