为什么以下对象工厂模式代码返回false ...
var Animal = function(name) {
var temp = new Object();
temp.name = name;
return temp;
}
var animal = Animal("fox");
console.log(animal instanceof Animal);
...而以下构造函数模式代码返回true;
var Animal = function(name) {
this.name = name;
}
var animal = new Animal("fox");
console.log(animal instanceof Animal);