Last active
March 1, 2021 16:28
-
-
Save lelouchB/3762e5870e4eace205379ffa3b72d9a7 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 outerFunction = function () { | |
let variable1 = "Example of closure" | |
var innerFunction = function () { | |
console.log(variable1) | |
} | |
return innerFunction; | |
} | |
var newFunction = outerFunction() | |
newFunction() | |
//Example of closure |
Thanks for pointing out the error
…On Fri, Aug 2, 2019, 1:27 PM doniseferi ***@***.***> wrote:
Hey great article on closures and lexical scoping. Update the return
statement to return innerFunction and not nested function 😃
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<https://gist.github.com/3762e5870e4eace205379ffa3b72d9a7?email_source=notifications&email_token=AK52CAUQ4FWSOR6LFA26I6DQCPSHDA5CNFSM4II3KO52YY3PNVWWK3TUL52HS4DFVNDWS43UINXW23LFNZ2KUY3PNVWWK3TUL5UWJTQAFWLWK#gistcomment-2987877>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AK52CAXOONR5DEDOHTBL6GDQCPSHDANCNFSM4II3KO5Q>
.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey great article on closures and lexical scoping. Update the return statement to return innerFunction and not nested function 😃