Created
June 17, 2020 21:28
-
-
Save christianwish/79d8f5e56615ecf9c9930908ae060b82 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const isGreateThan = n => m => (m > n); | |
const square = x => x * x; | |
const filter = f => arr => arr.filter(f); | |
const map = f => arr => arr.map(f); | |
const reduce = f => arr => arr.reduce(f); | |
const includes = v => arr => arr.includes(v); | |
const applyTo = x => f => f(x); | |
const all = f => arr => arr.filter(f).length === arr.length; | |
const data = [1, 2, 3, 4, 5, 13]; | |
const filterGreater3 = filter(isGreateThan(3)); | |
const mapSquare = map(square); | |
const result = all(isGreateThan(3))(data); | |
console.log(result); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment