Created
October 4, 2017 23:21
-
-
Save the-creature/fe95ae25860390f0e03ca1893c68d293 to your computer and use it in GitHub Desktop.
ES6 quick demo about closure
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 a = (type) => { | |
const t = 'Hi ' + type; | |
const s = () => { return t;} | |
return s; | |
} | |
const b = a('closure'); | |
b(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment