<!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;
this.name = function() {
return this.firstName + " " + this.lastName
};
}
// 人物のオブジェクトを作成する
const myFather = new Person("John", "Doe", 50, "blue");
// フルネームを表示
document.getElementById("demo").innerHTML =