crop_rotate
Run
<!DOCTYPE html> <html> <body> <h2>JavaScript Objects</h2> <p>The prototype property allows you to add new methods to objects constructors:</p> <p id="demo"></p> <script> function Person(first, last, age, eye) { this.firstName = first; this.lastName = last; this.age = age; this.eyeColor = eye; } Person.prototype.nationality = "Arabic "; const myFather = new Person("Mostaf", "ezzat", 50, "blue"); document.getElementById("demo").innerHTML = "The nationality of my father is " + myFather.nationality; </script> </body> </html>
PCFET0NUWVBFIGh0bWw+DQo8aHRtbD4NCjxib2R5Pg0KDQo8aDI+SmF2YVNjcmlwdCBPYmplY3RzPC9oMj4NCg0KPHA+VGhlIHByb3RvdHlwZSBwcm9wZXJ0eSBhbGxvd3MgeW91IHRvIGFkZCBuZXcgbWV0aG9kcyB0byBvYmplY3RzIGNvbnN0cnVjdG9yczo8L3A+DQoNCjxwIGlkPSJkZW1vIj48L3A+DQoNCjxzY3JpcHQ+DQpmdW5jdGlvbiBQZXJzb24oZmlyc3QsIGxhc3QsIGFnZSwgZXllKSB7DQogIHRoaXMuZmlyc3ROYW1lID0gZmlyc3Q7DQogIHRoaXMubGFzdE5hbWUgPSBsYXN0Ow0KICB0aGlzLmFnZSA9IGFnZTsNCiAgdGhpcy5leWVDb2xvciA9IGV5ZTsNCn0NCg0KUGVyc29uLnByb3RvdHlwZS5uYXRpb25hbGl0eSA9ICJBcmFiaWMgIjsNCg0KY29uc3QgbXlGYXRoZXIgPSBuZXcgUGVyc29uKCJNb3N0YWYiLCAiZXp6YXQiLCA1MCwgImJsdWUiKTsNCmRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCJkZW1vIikuaW5uZXJIVE1MID0NCiJUaGUgbmF0aW9uYWxpdHkgb2YgbXkgZmF0aGVyIGlzICIgKyBteUZhdGhlci5uYXRpb25hbGl0eTsgDQo8L3NjcmlwdD4NCg0KPC9ib2R5Pg0KPC9odG1sPg==