Here Symbol() is the symbol object whose primitive value is to be found.
Parameters: This function does not take any parameter.
Return value: This function returns the primitive value of the given symbol object.
> Symbol(Geeks) > Symbol(Geeks) > Symbol(123) > Symbol()
> Symbol(GeeksforGeeks) > Symbol(5) > Symbol(2) > Symbol(1)
In the above code, it can be seen that the parameter of symbol object should be a single parameter otherwise it considers the first element as the parameter and remaining are discarded. If the parameter is an arithmetic operation then it considers them as the result of the operation as the parameter.
- Chrome 38 and above
- Edge 12 and above
- Firefox 36 and above
- Opera 25 and above
- Safari 9 and above