<!DOCTYPE html>
<html>
<body>
<h2>JavaScript オブジェクト</h2>
<p>プロトタイプ プロパティを使用すると、オブジェクト コンストラクターに新しいメソッドを追加できます。</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 = ""English"";
const myFather = new Person(""John"", ""Doe"", 50, ""blue"");
document.getElementById(""demo"").innerHTML =
""The nationality of my father is "" + myFather.nationality;
</script>
</body>