代码示例:(标识:jsck_object_prototype)
<!DOCTYPE html>
<html>
<body>

<h1>JavaScript 对象</h1>

<h2>prototype 属性</h2>

<p id="demo"></p>

<script>
function Person(first, last, age, eye) {
  this.firstName = first;
  this.lastName = last;
  this.eyeColor = eye;
}
const myFather = new Person("Bill", "Gates", "blue");
const myMother = new Person("Steve", "Jobs", "green");

Person.prototype.nationality = "English";

document.getElementById("demo").innerHTML =
"My father is " + myFather.nationality + "<br>" +
"My mother is " + myMother.nationality;
</script>

</body>
</html>
运行结果: