Get to know MDN better
This page was translated from English by the community. Learn more and join the MDN Web Docs community.
This feature is well established and works across many devices and browser versions. It’s been available across browsers since апрель 2017 г..
Известный символ Symbol.toStringTag - это строковое значение свойства, которое используется при создании строки описания объекта по умолчанию. Доступ к нему осуществляется через Object.prototype.toString() метод.
| Записываемое | нет |
| Перечисляемое | нет |
| Настраиваемое | нет |
Многие Javascript типы имеют теги по умолчанию:
Другие имеют встроенный символ toStringTag:
При создании собственного класса JavaScript по умолчанию использует тег "Object":
С помощью toStringTag можно установить свой собственный тег:
| ECMAScript® 2027 Language Specification # sec-symbol.tostringtag |
Enable JavaScript to view this browser compatibility table.
This page was last modified on 28 мар. 2025 г. by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.