const make = (f, n) => f ? f(n) : n; const one = f => make(f, 1); const two = f => make(f, 2); const three = f => make(f, 3); const four = f => make(f, 4); const five = f => make(f, 5); const six = f => make(f, 6); const seven = f => make(f, 7); const eight = f => make(f, 8); const nine = f => make(f, 9); const ten = f => make(f, 10); const plus = a => b => b + a; const minus = a => b => b - a; const times = a => b => b * a; const dividedBy = a => b => b / a;
thanks, it's fun :)
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
thanks, it's fun :)