TGViewer
JavaScript test JavaScript test @js_test · 9.68K subscribers
Post #4765 891
❗️Что будет на выходе:
const original = Object.freeze({ a: [1, 2, 3] });
const copy = { ...original };

copy.a.push([...copy.a, ...original.a]);

console.log(original.a);
console.log(copy.a);

Ответ: [ 1, 2, 3, [ 1, 2, 3, 1, 2, 3 ] ]
[ 1, 2, 3, [ 1, 2, 3, 1, 2, 3 ] ]
JavaScript test | #JavaScript
More from @js_test
  1. Oct 17, 2026❗️Что будет на выходе: function greet(name) { return `Hello, ${name}!`; } function highlig…
  2. Oct 17, 2026❗️Что будет на выходе: const counter = (function () { let count = 0; const history = []; r…
  3. Oct 16, 2026❗️Что будет на выходе: const memoryLeak = () => { const cache = new Map(); const weakCache…
  4. Oct 16, 2026❗️Что будет на выходе: const createMathOps = (base) => { return { add: (x) => base + x, mu…
  5. Oct 16, 2026❗️Что будет на выходе: const person = { name: 'Alice', greet() { return `Hello, I'm ${this…
  6. Oct 15, 2026❗️Что будет на выходе: try { try { // Creating a custom error type class CustomError exten…
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 →