crop_rotate
Run
<!DOCTYPE html> <html> <body> <h2>JavaScript Objects</h2> <p>Using an object constructor:</p> <p id="demo"></p> <script> function Person(first, last, age, eye) { this.firstName = first; this.lastName = last; this.age = age; this.eyeColor = eye; this.nationality = "English"; } const myFather = new Person("ahmed", "hatem", 50, "blue"); const myMother = new Person("salah", "saleh", 48, "green"); document.getElementById("demo").innerHTML = "The nationality of my father is " + myFather.nationality + ". The nationality of my mother is " + myMother.nationality; </script> </body> </html>
PCFET0NUWVBFIGh0bWw+DQo8aHRtbD4NCjxib2R5Pg0KDQo8aDI+SmF2YVNjcmlwdCBPYmplY3RzPC9oMj4NCg0KPHA+VXNpbmcgYW4gb2JqZWN0IGNvbnN0cnVjdG9yOjwvcD4NCg0KPHAgaWQ9ImRlbW8iPjwvcD4NCg0KPHNjcmlwdD4NCmZ1bmN0aW9uIFBlcnNvbihmaXJzdCwgbGFzdCwgYWdlLCBleWUpIHsNCiAgdGhpcy5maXJzdE5hbWUgPSBmaXJzdDsNCiAgdGhpcy5sYXN0TmFtZSA9IGxhc3Q7DQogIHRoaXMuYWdlID0gYWdlOw0KICB0aGlzLmV5ZUNvbG9yID0gZXllOw0KICB0aGlzLm5hdGlvbmFsaXR5ID0gIkVuZ2xpc2giOw0KfQ0KDQpjb25zdCBteUZhdGhlciA9IG5ldyBQZXJzb24oImFobWVkIiwgImhhdGVtIiwgNTAsICJibHVlIik7DQpjb25zdCBteU1vdGhlciA9IG5ldyBQZXJzb24oInNhbGFoIiwgInNhbGVoIiwgNDgsICJncmVlbiIpOw0KDQpkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgiZGVtbyIpLmlubmVySFRNTCA9DQoiVGhlIG5hdGlvbmFsaXR5IG9mIG15IGZhdGhlciBpcyAiICsgbXlGYXRoZXIubmF0aW9uYWxpdHkgKyAiLiBUaGUgbmF0aW9uYWxpdHkgb2YgbXkgbW90aGVyIGlzICIgKyBteU1vdGhlci5uYXRpb25hbGl0eTsNCjwvc2NyaXB0Pg0KDQo8L2JvZHk+DQo8L2h0bWw+