
How to create the get and set property in JavaScript?

Creating Get and Set properties in JavaScript example..
myVar Sample = {
nval : "",
get get() { return this.nval; },
set get(val) { this.nval = val; }
}
Tutorial : JavaScript getAttribute method