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

const array = [1, 2, 3, 4, 5];
const [first, ...rest] = array;

const modified = rest.map((n, i) => i % 2 === 0 ? n * 2 : n);

console.log(first, modified);

Ответ: 1, [4, 3, 8, 5]

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