Symbol Methods javascript
// get symbol by name let sym = Symbol.for('hello'); let sym1 = Symbol.for('id'); // get name by symbol console.log( Symbol.keyFor(sym) ); // hello console.log( Symbol.keyFor(sym1) ); // id
what does the symbol function do in javascript
var idk={test:true,[Symbol.toStringTag]:'e'} consoel.log(idk)//e {test:true,[Symbol.toStringTag]:'e'} idk.toString()//[object e]
JavaScript Symbol
// two symbols with the same description const value1 = Symbol('hello'); const value2 = Symbol('hello');