new Symbol(_descriptionopt)
Create a "Symbol" which is actually just a string (so it works "like" a Symbol in older environments). Symbol is never used with new, it is meant to be invoked as a creator function:
var key = Symbol( "description" );
var obj = {};
obj[key] = "value";
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
_description |
string |
<optional> |
Optional: a description of the Symbol that will provide a hint of what the Symbol is for. Only for debug, does not affect the actual Symbol in any way. |
- Source:
Throws:
-
Throws a TypeError if used as a constructor (with new).
- Type
- TypeError