📅  最后修改于: 2022-03-11 15:02:31.830000             🧑  作者: Mango
/*Prototype is used to add properties/methods to a
constructor function as in example below */
function ConstructorFunction(name){
this.name = name //referencing to current executing object
}
ConstructorFunction.prototype.age = 18
let objectName = new ConstructorFunction("Bob")
console.log(objectName.age) //18