function person(first, last, age, eye) {
this.firstName = first;
this.lastName = last;
this.age = age;
this.eyeColor = eye;
}
var myFather = new person("John", "Doe", 50, "blue");
console.log(myFather instanceof person); //true
console.log(myFather instanceof Object); //true
console.log(myFather instanceof Function); //false
你好,在这种情况下,我们从函数构造函数创建了一个对象:'person'。
JavaScript 中的每个函数都是 Function 构造函数的一个实例。为什么 myFather 不是 Function 的实例?