(前端手撕)3.手撕instanceof
手撕instanceof
function instance (left,right){ var left = left.__proto__; var right = right.prototype; while(right){ if(left === right){ return true }else{ left = left.__proto__; } } return false; }
function instance (left,right){ var left = left.__proto__; var right = right.prototype; while(right){ if(left === right){ return true }else{ left = left.__proto__; } } return false; }
相关推荐