@ManavMisra/

SlushyReasonableDebugger

Nodejs

No description

fork
loading
Files
  • index.js
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
const inc = n => n + 1;
const double = n => n * 2;

const trace = label => value => console.log(label, value);

const pipe = (...fns) => init => fns.reduce((accumulator, fn) => fn(accumulator), init)

pipe(
  trace('world')
)('hello')

const compose = (f, g) => x => f(g(x));

const transform = compose(double, inc);
transform(3);
node v10.16.0