English
Open in Telegram

Post CHALLENGE

30 October 2026
J
JavaScript
CHALLENGE const wm = new WeakMap(); class Counter { #id; static #nextId = 0; constructor() { this.#id = Counter.#nextId++; wm.set(this, { count: 0, id: this.#id }); } inc() { const data = wm.get(this); data.count++; return data.count; } } const a = new Counter(); const b = new Counter(); a.inc(); a.inc(); b.inc(); console.log(`${a.inc()} ${b.inc()} ${wm.has(a)} ${wm.get(a).id} ${wm.get(b).id}`);
876 ·

Nearby in the feed

JJavaScriptCHALLENGE const base = { greet() { return 'hi'; } }; const obj = Object.create(base, { x: { value: 1, enumerable: true }, y: { value: 2, enumerable: false } });JJavaScriptPoll
this message
JJavaScriptPollJJavaScriptCHALLENGE const createCounterModule = (() => { let instances = 0; return function() { instances++; let count = 0; return { increment() { count++; return count;
JJavaScriptJavaScript@javascript · channel · Tech
30 984subscribers1 565average post reach
Venue feed Open in Telegram

An open public feed from the search index ChatCrawler — “Google for public Telegram”; refreshed as the venue is crawled. Times are UTC.

Public content only, official Telegram API. About · FAQ · Index limits · Remove a page · Catalog · Search · How we count