TGViewer
JavaScript test JavaScript test @js_test · 9.74K subscribers
Post #6341 383
❗️Что будет на выходе:

const wm = new WeakMap();
const obj1 = { name: 'first' };
const obj2 = { name: 'second' };

wm.set(obj1, 'value1');
wm.set(obj2, 'value2');

const keys = [];
for (let key of wm) {
keys.push(key);
}

console.log(keys.length);
console.log(wm.has(obj1));
console.log(wm.get(obj2));

console.log(sum);

Ответ: TypeError: vm is noy iterable

JavaScript test | #JavaScript
More from @js_test
  1. Sep 27, 2026❗️Что будет на выходе: function processConfig(config) { const cache = config.cache ?? true…
  2. Sep 27, 2026Хочешь заговорить на английском, но не с кем практиковаться? Появилась ИИ-девушка, с котор…
  3. Sep 27, 2026❗️Что будет на выходе? const user = { profile: { name: 'Alice', settings: { notifications:…
  4. Sep 26, 2026❓Что будет на выходе? function recursivePascalTriangle(n, row = [1], triangle = []) { tria…
  5. Sep 26, 2026❗️Что будет на выходе: const regex = /a/g; const str = 'banana'; console.log(str.match(reg…
  6. Sep 26, 2026❗️Что будет на выходе: class MyClass { constructor() { this.a = 100; } } MyClass.prototype…
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 →