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 withoutnew
. Attempting to construct it withnew
throws aTypeError
.
Parameters
description
optional- : A string. A description of the symbol which can be used for debugging but not to access the symbol itself.