Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
</body>
</html>
 
    const _pipe = (f, g) => (...args) => g(f(...args))
    const pipe = (...fns) => fns.reduce(_pipe);
    const partial = (fn, ...args) => fn.bind(null, ...args);
    const curry = fn => (...args) => fn.bind(null, ...args);  
    const add = (a, b, c = 0) => a + b + c;
    const multiply = (a, b) => a * b;
    const dec = (a) => a - 1; 
    const calculatePipeline = pipe(multiply, dec, partial(add,10,3));
    const resultCalculate = calculatePipeline(2, 4);
    console.log('result', resultCalculate)
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
ysfzrnpro
0viewers