Skip to main content
Version: 3.21.2

Symbol()

The Symbol() constructor returns a value of type symbol, but is incomplete as a constructor because it does not support the syntax "new Symbol()" and it is not intended to be subclassed. It may be used as the value of an extends clause of a class definition but a super call to it will cause an exception.

Syntax

Symbol()
Symbol(description)

Note: Symbol() can only be called without new. Attempting to construct it with new throws a TypeError.

Parameters

  • description optional
    • : A string. A description of the symbol which can be used for debugging but not to access the symbol itself.