Symbol.prototype[Symbol.toPrimitive]()
Symbol.prototype[Symbol.toPrimitive]() is a JavaScript method in the Symbol category. Converts the symbol to a primitive. The syntax is symbol[Symbol.toPrimitive](hint). A typical example: Symbol("s")[Symbol.toPrimitive](). A close sibling is Symbol(), which creates a unique symbol. A close sibling is Symbol.for(), which looks up or creates a symbol in the global registry. A close sibling is Symbol.keyFor(), which returns the key of a global symbol. A close sibling is Symbol.prototype.toString(), which returns a string representation. More about this category: Symbol methods and properties. Related Symbol methods: Symbol(), Symbol.for(), Symbol.keyFor(), Symbol.prototype.toString(), Symbol.iterator, Symbol.asyncIterator, Symbol.hasInstance, Symbol.toStringTag. This page is part of the free JS Reference documentation covering 1027+ methods, each with syntax, parameters, return values, examples, and common pitfalls. You can try Symbol.prototype[Symbol.toPrimitive]() immediately in the JavaScript playground, look up unfamiliar terms in the glossary, or return to the JS Reference homepage.