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

const data = [1, 2, 3, 4, 5];

const result = data.reduce((acc, val) => acc.concat(Array.from({ length: val }, (_, index) => val + index)), []);

console.log(result);

Ответ: [1, 2, 3, 3, 4, 5, 4, 5, 6, 7, 5, 6, 7, 8, 9]

JavaScript test | #JavaScript & Max
More from @js_test
  1. Sep 21, 2026❗️Что будет на выходе? async function test() { console.log('1'); setTimeout(() => { consol…
  2. Sep 21, 2026❓Что будет на выходе? 'use strict'; function strictModeExample() { undeclaredVariable = 10…
  3. Sep 20, 2026❗️Что будет на выходе? async function test() { console.log('1'); setTimeout(() => { consol…
  4. Sep 20, 2026❗️Что будет на выходе? const user = { profile: { name: 'Alice', settings: { notifications:…
  5. Sep 20, 2026❗️Что будет на выходе? function* range(start, end) { while (start < end) { yield start++;…
  6. Sep 19, 2026❗️Что будет на выходе: const arr = [3, 8, 12]; const even = (elem) => elem % 2 === 0; cons…
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 →