changes var to let in scope - #247
Merged
Merged
Conversation
AnshulMalik
reviewed
Oct 21, 2018
|
|
||
| ```js | ||
| var a = 4; // a is a global variable, it can be accessed by the functions below | ||
| let a = 4; // a is a global variable, it can be accessed by the functions below |
Contributor
There was a problem hiding this comment.
Can we make it const?
Author
There was a problem hiding this comment.
Can we make it
const?
yep, one moment
AnshulMalik
reviewed
Oct 21, 2018
| // defined inside foo | ||
| function bar(c) { | ||
| var b = 2; // another `b` variable is created inside bar function scope | ||
| let b = 2; // another `b` variable is created inside bar function scope |
Contributor
There was a problem hiding this comment.
Ohh, let's fix the indentation too :)
Contributor
|
We can use template literals here |
lksei
force-pushed
the
scope_to_es6
branch
19 times, most recently
from
October 21, 2018 06:33
b9fde94 to
552b9ca
Compare
Author
|
i'm done |
lksei
force-pushed
the
scope_to_es6
branch
3 times, most recently
from
October 21, 2018 07:26
89691df to
ed7ef36
Compare
lksei
force-pushed
the
scope_to_es6
branch
3 times, most recently
from
October 21, 2018 07:31
7f9ea8d to
ca7252e
Compare
Contributor
|
Love it! Thanks @alexey-pd |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
contribution to issue #229