JS: Symbol.prototype

By Xah Lee. Date: . Last updated: .

(new in ECMAScript 2015)

What is Symbol.prototype

Symbol.prototype is the parent of all symbol objects.

Properties

work in progress

Symbol.prototype.constructor

Symbol.prototype.description

Return the description of the symbol.

Symbol.prototype.toString( )

return a string of the form:

"Symbol(description)"

console.assert(Symbol("xyz").toString() === "Symbol(xyz)");

Symbol.prototype.valueOf ( )

Symbol.prototype [ Symbol.toPrimitive ] ( hint )

Symbol.prototype [ Symbol.toStringTag ]