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

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

const pipeline = (...fns) => (value) => fns.reduce((acc, fn) => fn(acc), value);

const multiply = (x) => (y) => x * y;
const add = (x) => (y) => x + y;
const square = (x) => x * x;

const transform = pipeline(
multiply(2),
add(3),
square
);

const result = numbers.map(transform);
console.log(result);

Ответ: [25, 49, 81, 121, 169]

JavaScript test | #JavaScript & Max
More from @js_test
  1. Sep 28, 2026❗️Что будет на выходе? const arr = []; arr.length = 3; arr[10] = 7; arr.forEach((el, i) =>…
  2. Sep 28, 2026👩‍💻 Всем программистам посвящается! Вот 14 авторских обучающих IT каналов по самым востр…
  3. Sep 27, 2026❗️Что будет на выходе: function processConfig(config) { const cache = config.cache ?? true…
  4. Sep 27, 2026Хочешь заговорить на английском, но не с кем практиковаться? Появилась ИИ-девушка, с котор…
  5. Sep 27, 2026❗️Что будет на выходе? const user = { profile: { name: 'Alice', settings: { notifications:…
  6. Sep 26, 2026❓Что будет на выходе? function recursivePascalTriangle(n, row = [1], triangle = []) { tria…
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 →