crop_rotate
Run
<!DOCTYPE html> <html> <body> <h2>JavaScript Object Constructors</h2> <p id="demo"></p> <script> // Constructor function for Person objects function Person(first, last, age, eye) { this.firstName = first; this.lastName = last; this.age = age; this.eyeColor = eye; } // Create two Person objects const myFather = new Person("Ahmed", "Mohamed", 50, "blue"); const myMother = new Person("Mahmoud", "Adel", 48, "green"); // Display age document.getElementById("demo").innerHTML = "My father is " + myFather.age + ". My mother is " + myMother.age + "."; </script> </body> </html>
PCFET0NUWVBFIGh0bWw+DQo8aHRtbD4NCjxib2R5Pg0KDQo8aDI+SmF2YVNjcmlwdCBPYmplY3QgQ29uc3RydWN0b3JzPC9oMj4NCg0KPHAgaWQ9ImRlbW8iPjwvcD4NCg0KPHNjcmlwdD4NCg0KLy8gQ29uc3RydWN0b3IgZnVuY3Rpb24gZm9yIFBlcnNvbiBvYmplY3RzDQpmdW5jdGlvbiBQZXJzb24oZmlyc3QsIGxhc3QsIGFnZSwgZXllKSB7DQogIHRoaXMuZmlyc3ROYW1lID0gZmlyc3Q7DQogIHRoaXMubGFzdE5hbWUgPSBsYXN0Ow0KICB0aGlzLmFnZSA9IGFnZTsNCiAgdGhpcy5leWVDb2xvciA9IGV5ZTsNCn0NCg0KLy8gQ3JlYXRlIHR3byBQZXJzb24gb2JqZWN0cw0KY29uc3QgbXlGYXRoZXIgPSBuZXcgUGVyc29uKCJBaG1lZCIsICJNb2hhbWVkIiwgNTAsICJibHVlIik7DQpjb25zdCBteU1vdGhlciA9IG5ldyBQZXJzb24oIk1haG1vdWQiLCAiQWRlbCIsIDQ4LCAiZ3JlZW4iKTsNCg0KLy8gRGlzcGxheSBhZ2UNCmRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCJkZW1vIikuaW5uZXJIVE1MID0NCiJNeSBmYXRoZXIgaXMgIiArIG15RmF0aGVyLmFnZSArICIuIE15IG1vdGhlciBpcyAiICsgbXlNb3RoZXIuYWdlICsgIi4iOyANCg0KPC9zY3JpcHQ+DQoNCjwvYm9keT4NCjwvaHRtbD4=