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
const test = document.createElement("button"); test.toString(); // "[object HTMLButtonElement]" test[Symbol.toStringTag]; // "HTMLButtonElement"
根据实际例子应该是属性是字符串而不是指向一个方法。 实际上
class Collection { get [Symbol.toStringTag]() { return 'xxx'; } } let x = new Collection(); Object.prototype.toString.call(x) // "[object xxx]"
中Collection的[Symbol.toStringTag] 在实例化的时候变成了字符串,也不应该说是指向一个方法。
// 字符串'xxx' x[Symbol.toStringTag]
而我试了放方法在里面是无法修改第二个Object的。
var obj = {[Symbol.toStringTag](){return 'xxx'}}; obj.toString() // '[object Object]'
The text was updated successfully, but these errors were encountered:
对象的Symbol.toStringTag属性,指向一个方法。
Symbol.toStringTag
是这一句吗?
Sorry, something went wrong.
docs(symbol): fixed #1166 Symbol.toStringTag
4c06dfb
docs(symbol): edit Symbol.toStringTag #1166
b1b35cd
No branches or pull requests
根据实际例子应该是属性是字符串而不是指向一个方法。
实际上
中Collection的[Symbol.toStringTag] 在实例化的时候变成了字符串,也不应该说是指向一个方法。
而我试了放方法在里面是无法修改第二个Object的。
The text was updated successfully, but these errors were encountered: