📌  相关文章
📜  构造函数 javascript 并从中创建对象 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:04.477000             🧑  作者: Mango

代码示例1
// Constructor function for Person objects

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

// Create a Person object
const myFather = new Person("John", "Doe", 50, "blue");