Skip to content

Latest commit

 

History

History
27 lines (16 loc) · 576 Bytes

README.md

File metadata and controls

27 lines (16 loc) · 576 Bytes

subtract

The subtract function is a curried binary function that subtracts the two values together and returns the result.

why?

JavaScript has a built in operator that will subtract two values together, but it does not compose well if you want to mix it with other functions, there may be times you know one number, but not the second number until some time as the program runs.

drawbacks

Example

const subtract5 = subtract(5)

subtract5(10) === 5
subtract5(20) === 15

return