We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
并实现一个instanceof
instanceof
The text was updated successfully, but these errors were encountered:
typeof与instacne都是js变量类型检测的运算符
在js中,typeof是检测基础类型的神器,对于所有引用类型的返回都是object;
当检测某个实例是不是当前对象的实例的时候,就到了instance大展拳脚的时刻了。
// 左边表达式和右边表达式 instanceOf (L, R) { L = L.__proto__; R = R.prototype; While(true) { if (L == null) return false; if (L == R) return true; L = L.__proto__ } }
Sorry, something went wrong.
No branches or pull requests
The text was updated successfully, but these errors were encountered: