Created
May 11, 2019 08:11
-
-
Save yurist38/31ac4f33d69532960c0d18de2838fe08 to your computer and use it in GitHub Desktop.
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
function addN(base: number): (a: number) => number { | |
let baseNumber = base; | |
return (addition: number): number => baseNumber + addition; | |
} | |
const addEight = addN(8); | |
console.log(addEight(7)); // 15 | |
console.log(addEight(100)); // 108 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment