TGViewer
JavaScript JavaScript @javascript · 31K subscribers
Post #3543 383
CHALLENGE

const sym1 = Symbol('id');
const sym2 = Symbol('id');

const obj = {
[sym1]: 'first',
[sym2]: 'second',
regular: 'value'
};

const s = Symbol.for('shared');
const s2 = Symbol.for('shared');

console.log(
sym1 === sym2,
Object.keys(obj).length,
Reflect.ownKeys(obj).length,
s === s2,
sym1.toString()
);
More from @javascript
  1. Oct 7, 2026Post #3544
  2. Oct 6, 2026Post #3542
  3. Oct 6, 2026CHALLENGE async function* gen() { const x = yield 1; const y = yield x + 1; return x + y;…
  4. Oct 5, 2026🎵 Tonny Espeset has recreated the '80s hit Take on Me by A-ha in pure JavaScript (along w…
  5. Oct 5, 2026Post #3539
  6. Oct 5, 2026CHALLENGE class Base { static log = []; static { Base.log.push('base-block'); } static val…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →