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

const obj1 = { a: 1, b: { c: 2 } };
const obj2 = { ...obj1 };
const obj3 = obj1;

obj2.a = 10;
obj2.b.c = 20;
obj3.b.c = 30;

console.log(obj1.a);
console.log(obj1.b.c);
console.log(obj2.a);
console.log(obj2.b.c);
console.log(obj3.a);
console.log(obj3.b.c);

Ответ: 1 30 10 30 1 30

JavaScript test | #JavaScript & Max
More from @js_test
  1. Sep 25, 2026❓Что будет на выходе? 'use strict'; function strictModeExample() { undeclaredVariable = 10…
  2. Sep 25, 2026❓Что будет на выходе? function mystery(x) { return (function(y) { return x + y; })(x * 2);…
  3. Sep 24, 2026❗️Что будет на выходе: const str = " Hello, World! "; const result = str .trim() .split(",…
  4. Sep 24, 2026❗️Что будет на выходе: function highlight(strings, ...values) { return strings.reduce((res…
  5. Sep 24, 2026❗️Что будет на выходе: function processData({ a = 10, b = 20 } = { a: 30 }) { console.log(…
  6. Sep 23, 2026❗️Что будет на выходе? const team = { members: ['Alice', 'Bob', 'Charlie'], [Symbol.iterat…
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 →