crop_rotate
Run
<!DOCTYPE html> <html> <body> <h2>JavaScript Getters and Setters</h2> <p>Getters and setters allow you to get and set properties via methods.</p> <p id="demo"></p> <script> // Create an object: const person = { firstName: "Mahmoud", lastName: "alaa", language: "en", get lang() { return this.language.toUpperCase(); } }; // Display data from the object using a getter: document.getElementById("demo").innerHTML = person.lang; </script> </body> </html>
PCFET0NUWVBFIGh0bWw+DQo8aHRtbD4NCjxib2R5Pg0KDQo8aDI+SmF2YVNjcmlwdCBHZXR0ZXJzIGFuZCBTZXR0ZXJzPC9oMj4NCg0KPHA+R2V0dGVycyBhbmQgc2V0dGVycyBhbGxvdyB5b3UgdG8gZ2V0IGFuZCBzZXQgcHJvcGVydGllcyB2aWEgbWV0aG9kcy48L3A+DQoNCjxwIGlkPSJkZW1vIj48L3A+DQoNCjxzY3JpcHQ+DQovLyBDcmVhdGUgYW4gb2JqZWN0Og0KY29uc3QgcGVyc29uID0gew0KZmlyc3ROYW1lOiAiTWFobW91ZCIsDQogIGxhc3ROYW1lOiAiYWxhYSIsDQogIGxhbmd1YWdlOiAiZW4iLA0KICBnZXQgbGFuZygpIHsNCiAgICByZXR1cm4gdGhpcy5sYW5ndWFnZS50b1VwcGVyQ2FzZSgpOw0KICB9DQp9Ow0KLy8gRGlzcGxheSBkYXRhIGZyb20gdGhlIG9iamVjdCB1c2luZyBhIGdldHRlcjoNCmRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCJkZW1vIikuaW5uZXJIVE1MID0gcGVyc29uLmxhbmc7DQo8L3NjcmlwdD4NCg0KPC9ib2R5Pg0KPC9odG1sPg==