Last active
December 15, 2017 11:33
-
-
Save Arieg419/83e21309574552aa266f77d70db280fc 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 bankStatement = | |
name => | |
location => | |
balance => | |
`Hello ${name}! Welcome to the bank of ${location}. Your current balance is ${balance}`; | |
const statementExpectingLocation = bankStatement("Omer"); | |
const statementExpectingBalance = statementExpectingLocation("NYC"); | |
const bankStatementMsg = statementExpectingBalance("100 million"); // wishful thinking? | |
console.log(bankStatementMsg); // Hello Omer! Welcome to the bank of NYC. Your current balance is 100 million | |
// We could also call the function with all the arguments up front | |
const msg = bankStatement("Jeff Bezos")("Silicon Valley")("97.7 billion"); | |
console.log(msg); // Hello Jeff Bezos! Welcome to the bank of Silicon Valley. Your current balance is 97.7 billion |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment