Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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
 
PREVIOUS NEXT
Tagged: #Symbol #Methods #javascript
ADD COMMENT
Topic
Name
6+3 =