What can the accessor property get set in js do? What functions can be used in the actual project?

clipboard.png

Mar.20,2021

accessors are generally used to encapsulate and control access behavior.
take the above picture as an example. For example, if you need to control the age at least 18 years old, you can decide not to save it in set if you are younger than 18 years old.


Acceesor mechanism, some MVVM frameworks use responsive

through getter and setter .
  

one of the implementation principles of the mvvm framework: data hijacking is done with get set.

Menu