function instanceOf( L, R ) { //L 表示左表达式,R 表示右表达式
var P = R.prototype; // 取 R 的显示原型
L = L.__proto__; // 取 L 的隐式原型
while ( true ) {
if ( L === null ) return false;
if ( P === L ) return true;
L = L.__proto__;
}
}
复制代码