Getter & Setter in JavaScript / ES6

Опубликовано: 16 Ноябрь 2024
на канале: JavaScript Talks
6,020
139

ES6 allows us to write custom getter setter functions for any object properties. It is very convenient to write a getter function for a computed value. And if you need to validate the property value, you can easily add validation in setter functions.


For more JavaScript news, tips and tutorials, don't forget to subscribe to JavaScriptTalks :)