<!DOCTYPE html>
<html>
<body>
<h2>JavaScript オブジェクト コンストラクター</h2>
<p id="demo"></p>
<script>
// 人物のオブジェクトのコンストラクター関数
function Person(first, last, age, eye) {
this.firstName = first;
this.lastName = last;
this.age = age;
this.eyeColor = eye;
}
// 人物のオブジェクトを 2 つ作成する
const myFather = new Person("John", "Doe", 50, "blue");
const myMother = new Person("Sally", "Rally", 48, "green");
// 最初のオブジェクトに国籍を追加します
myFather.nationality = "English";
// 国籍を表示する
document.getElementById("demo").innerHTML =