JavaScript Symbol toStringTag Property Last Updated : 07 Aug, 2023 Summarize Comments Improve Suggest changes Share Like Article Like Report The Symbol.toStringTag is a well-known symbol and string-valued property in JavaScript which is used in the creation of the default string description of an object. Syntax: Symbol.toStringTagParameters: This does not take any parameter. Return value: This returns the String Object. Example 1: In this example, we will use Symbol toStringTag Property javascript // Illustrating Symbol.toStringTag console.log(Object.prototype.toString.call('Geeks')); console.log(Object.prototype.toString.call("Geeks")); console.log(Object.prototype.toString.call([1, 2, 3, 4])); console.log(Object.prototype.toString.call(5)); console.log(Object.prototype.toString.call(true)); console.log(Object.prototype.toString.call(false)); console.log(Object.prototype.toString.call(undefined)); console.log(Object.prototype.toString.call(null)); Output[object String] [object String] [object Array] [object Number] [object Boolean] [object Boolean] [object Undefined] [object Null]Example 2: In this example, we will use Symbol toStringTag Property javascript // Illustrating Symbol.toStringTag class ToString { get [Symbol.toStringTag]() { return 'GeeksforGeeks'; } } // Getting the string description of the object console.log(Object.prototype.toString.call(new ToString())); Output[object GeeksforGeeks]Supported Browsers: Google Chrome 49Firefox 51Edge 15Opera 36 and aboveApple Safari 10 and aboveReference: https://devdocs.io/javascript/global_objects/symbol/tostringtag Comment More infoAdvertise with us K Kanchan_Ray Follow Improve Article Tags : JavaScript Web Technologies JavaScript-Properties JavaScript-Symbol Similar Reads JavaScript Symbol() Constructor The Symbol() constructor is used to create a new symbol. The Symbol() constructor returns a value of the type of symbol with static properties. Every time we call the constructor a unique symbol is created. A Symbol constructor is a primitive data type having no object or no methods which are genera 2 min read JavaScript Symbol constructor Property JavaScript Symbol constructor property is used to return the Symbol constructor function for the object. The function returned by this property is just the reference, not the actual WeakSet. It is an object property of JavaScript and can be used with Strings, Numbers, etc. Syntax: symbol.constructor 1 min read JavaScript Symbol asyncIterator Property JavaScript Symbol asyncIterator property is used to set an object as an async iterable. Iterable properties of this object can be iterated over using a for await...of loop. An async iterable object is any object that returns a function that produces an AsyncIterator for its Symbol.asyncIterator prop 2 min read JavaScript Symbol description Property 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;Paramete 1 min read JavaScript Symbol hasInstance Property JavaScript Symbol hasInstance is used to determine if a given constructor object recognizes the object as its instance. Syntax: [Symbol.hasInstance](Object) Parameters: It accepts a parameter "object". Return value: This returns true if the value is in the chain of the object otherwise false.JavaScr 1 min read JavaScript Symbol isConcatSpreadable Property JavaScript Symbol.isConcatSpreadable is a well-known symbol used to configure if a given object should be flattened to its array elements while using the Array.prototype.concat() method. Syntax: Array[Symbol.isConcatSpreadable]Here Array is the array object which is to be flattened to its array elem 2 min read JavaScript Symbol iterator Property It is an object of Iterables which is also a kind of generalized arrays. Iterables that make any object easier to use in a for..of the loop. We know that arrays are iterative in nature but other than that, there are also several objects which are used for the iterative purpose. Suppose if any object 2 min read JavaScript Symbol match Property JavaScript Symbol match property is used to identify the matching of a regular expression against a string and this function is called using String match() method. Syntax: regexp[Symbol.match] = false; Parameters: It does not accept any parameters. Return value: It will return the Boolean value for 1 min read JavaScript Symbol matchAll Property JavaScript Symbol matchAll property used to return the regular expression that matches against a string. JavaScript String matchAll() method calls this property. Syntax: regExp[Symbol.matchAll](str); Parameter: It takes a string used to find matches of the regular expression against the string. Retu 2 min read JavaScript Symbol replace Property JavaScript Symbol replace the property is used to determine the method that replaces the matched substring of a string. This function is called by the String replace() method. Syntax: [Symbol.replace](string) Parameters: It accepts single parameter "String". Return value: It will return a new string 2 min read Like