Created
November 4, 2018 13:52
-
-
Save AlexP11223/fe35e40fb01d2964b8f98b6ed9deb207 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
var doOnce = function() { | |
var completed = false; | |
return function() { | |
if (!completed) { | |
console.log('hello'); | |
completed = true; | |
} | |
}; | |
}(); | |
doOnce(); | |
doOnce(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment