What is the purpose of get and set keyword in ES6. I have seen the below given example. Code Example. This could be done without using the get and set keyword so why we use it.
get area() {
return this.height * this.width;
}
set area(value) {
this.area = value;
}