underscore
underscore copied to clipboard
about the prototype chain of _.bind when there is no native bind, what the details as below
function Animal(name,color){ this.name = name; this.color = color; }
var Cat = _.bind(Animal,{},"jerry"); var cat = new Cat('red'); //case1 console.log(cat instanceof Animal); //return true;
case2 console.log(cat instanceof Cat); //return false;
//Ps: I think in the case2 , it should be true;