JavaScript
32.1K subscribers
1.05K photos
10 videos
33 files
730 links
A resourceful newsletter featuring the latest and most important news, articles, books and updates in the world of #javascript πŸš€ Don't miss our Quizzes!

Let's chat: @nairihar
Download Telegram
CHALLENGE

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));
What is the output?
Anonymous Quiz
26%
5
42%
Result: 20
23%
Result: 25
9%
Result: 30
❀3πŸ‘1πŸ”₯1
🀟 Awesome Node: Over 500 Curated Packages, Resources and Links

It’s been more than four years since we linked to Sindre's handy resource, but it continues to get updates and tweaks (and, if you want, you can contribute a submission too – though the bar is quite high).

Sindre Sorhus
Please open Telegram to view this post
VIEW IN TELEGRAM
❀3πŸ‘1πŸ”₯1