JavaScript Symbol.for() MethodThe JavaScript Symbol.for() method is used to search for existing symbol in a runtime-wide symbol registry with the provided key and returns if it found. Otherwise, a new symbol gets created with this key. SyntaxParametersKey: The Keys to the symbol. Return valueExisting symbol with the given key if found otherwise, a new symbol is created and returned. Browser Support
Example 1Test it NowOutput: true Example 2Test it NowOutput: true
Next TopicJavaScript Symbol
|