![]() |
VOOZH | about |
JavaScript symbol description is an inbuilt property in JavaScript that is used to return the optional description of the specified symbol objects.
Syntax: Here "A" is the specified symbol object which might be Symbol('anyValues'), Symbol.iterator, Symbol.for('anyValues') etc.
A.description;Parameters: This property does not accept any parameter.
Return value: This property returns the optional description of the specified symbol objects.
Example 1: The below examples illustrate the JavaScript Symbol description Property.
Geek Symbol.iterator GeeksforGeeks GeeksforGeeks
Example 2: The below examples illustrate the JavaScript Symbol description Property.
undefined
In the above code, the symbol object "Symbol()" should have some parameters otherwise it gives undefined as the output.
We have a complete list of Javascript symbols' properties and methods, to check those please go through the Javascript Symbol Complete Reference article.