Getter & Setter in JavaScript / ES6

preview_player
Показать описание
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 :)
Рекомендации по теме
Комментарии
Автор

i will build you a monument!!!
Thank you so much. i finally got the point of getters and setters after so much struggle haha

gabrielska
Автор

simple and useful, Nice explanation 🔥

visheshgupta
Автор

I''ve never watched this much easy-to-understand video. :D
Absolutely AMAZING!!!!

Ty sir :)

Btw, are getters and setters commonly used nowadays?

aleksazlatkovic
Автор

Thank you!
how do we use arrow functions with get and set?

DaviesMaina