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

class DataProcessor {
constructor(transform) {
this.transform = transform;
}

process(data) {
return this.transform(data);
}
}

const multiply = x => x * 2;
const addTen = x => x + 10;
const toString = x => `Result: ${x}`;

const compose = (...fns) => x => fns.reduceRight((acc, fn) => fn(acc), x);

const processor = new DataProcessor(compose(toString, addTen, multiply));
console.log(processor.process(5));

Ответ: Result: 20

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