Skip to content

Commit

Permalink
docs(symbol): fixed #1166 Symbol.toStringTag
Browse files Browse the repository at this point in the history
  • Loading branch information
ruanyf committed Aug 22, 2023
1 parent 5d3be2b commit 7c2b334
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/symbol.md
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,7 @@ String(obj) // 'str'

### Symbol.toStringTag

对象的`Symbol.toStringTag`属性,指向一个方法。在该对象上面调用`Object.prototype.toString`方法时,如果这个属性存在,它的返回值会出现在`toString`方法返回的字符串之中,表示对象的类型。也就是说,这个属性可以用来定制`[object Object]``[object Array]``object`后面的那个字符串。
对象的`Symbol.toStringTag`属性,返回一个字符串。在目标对象上面调用`Object.prototype.toString`方法时,如果`Symbol.toStringTag`属性存在,它的返回值会出现在`toString`方法返回的字符串之中,表示对象的类型。也就是说,这个属性可以用来定制`[object Object]``[object Array]``object`后面的那个字符串。

```javascript
// 例一
Expand Down

0 comments on commit 7c2b334

Please sign in to comment.