📜  js 为什么要使用 getter 和 setter - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:43.743000             🧑  作者: Mango

代码示例1
1) Syntax reasons. It’s easier and faster to read code 
created with accessor functions
2) Encapsulation. I can create safer code with accessor functions.