Created
October 31, 2018 11:04
-
-
Save ufocoder/19747dde65cf409b2e355a1ed442a4f2 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 rememberX (x) { | |
| return function getX () { | |
| return x; | |
| }; | |
| } | |
| // В ES6 этот же код может быть представлен так: | |
| // const rememberX = x => () => x; | |
| const get42 = rememberX(42); | |
| const get36 = rememberX(36); | |
| const get18 = rememberX(18); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment