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
@Tan90Qian 厉害了,我也才发现,原来:
Object.prototype.toString.call(location) // "[object Location]" Object.prototype.toString.call(history) // "[object History]"
而且他们跟自身相等是因为引用是相同的吧,就像:
var obj = {}; console.log(obj === obj) // true
Originally posted by @mqyqingfeng in #28 (comment)
The text was updated successfully, but these errors were encountered:
请问既然Object.prototype.toString.call(window)会得到window,为什么全局直接执行Object.prototype.toString()不返回window
Sorry, something went wrong.
Object.prototype.toString.call(window)实际会调用window[Symbol.toStringTag]。 window[Symbol.toStringTag] // Window
window[Symbol.toStringTag] // Window
那如果window.Object.prototype.toString(),执行方法中的this是指向Object,为啥不是window
因为不是window调用toString,注意this指向,a.b.c.funfun的this是c,不是a
a.b.c.fun
No branches or pull requests
@Tan90Qian 厉害了,我也才发现,原来:
而且他们跟自身相等是因为引用是相同的吧,就像:
Originally posted by @mqyqingfeng in #28 (comment)
The text was updated successfully, but these errors were encountered: