Created
August 30, 2018 09:02
-
-
Save ruliarmando/9dc30ff686717bc5d70132fbd5f1efcb to your computer and use it in GitHub Desktop.
Dynamic greater than function factory
This file contains hidden or 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 greaterThan = (thisNumber) => (anotherNumber) => anotherNumber > thisNumber; | |
const greaterThan10 = greaterThan(10); | |
const greaterThan2 = greaterThan(2); | |
console.log('12 > 10 = ', greaterThan10(12)); // 12 > 10 = True | |
console.log('8 > 10 = ', greaterThan10(8)); // 8 > 10 = False | |
console.log('3 > 2 = ', greaterThan2(3)); // 3 > 2 = True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment