prototypes in JS

PHOTO EMBED

Thu Aug 12 2021 17:32:24 GMT+0000 (Coordinated Universal Time)

Saved by @Gold #javascript

function Person(first, last, age, eye) {
this.firstName = first;
this.lastName = last;
this.age = age;
this.eyeColor = eye;
}

Person.prototype.nationality = "English";

var myFather = new Person("John", "Doe", 50, "blue");
console.log("The nationality of my father is " + myFather.nationality)
content_copyCOPY

https://www.google.com/search?q