romaklimenko
10/21/2016 - 3:21 PM

compose.js

const compose = (g, f) => a => g(f(a))

const f = a => a % 2 == 0

const g = b => b ? "True" : "False"

const composed = compose(g, f)

console.assert(composed(2) === "True")
console.assert(composed(3) === "False")