TGViewer
JavaScript test JavaScript test @js_test · 9.7K subscribers
Post #5409 726
❗️Что будет на выходе:
const nums = [1, 2, 3];
const obj = { a: 1, b: 2, c: 3 };

function process(...args) {
const [first, ...rest] = args;
const { a, ...others } = obj;
return { first, rest, a, others };
}

const result = process(...nums);
console.log(result.first);
console.log(result.rest.length);
console.log(result.others.b);
console.log(Object.keys(result.others).join(''));
console.log(result.a === nums[0]);


Ответ: 1 2 2 bc true

JavaScript test | #JavaScript
More from @js_test
  1. Oct 9, 2026❗️Что будет на выходе: function* gen() { yield 1; yield 2; yield 3; } async function async…
  2. Oct 9, 2026❗️Что будет на выходе: const person = { name: 'Alice', greet() { return `Hello, I'm ${this…
  3. Oct 8, 2026❗️Что будет на выходе: function processData({ a = 10, b = 20 } = { a: 30 }) { console.log(…
  4. Oct 8, 2026Дизайнер, айтишник, продажник или маркетолог – а что, если часть вашей работы заберет Clau…
  5. Oct 7, 2026❗️Что будет на выходе? const team = { members: ['Alice', 'Bob', 'Charlie'], [Symbol.iterat…
  6. Oct 7, 2026❗️Что будет на выходе: function processConfig(config) { const cache = config.cache ?? true…
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 →