Skip to content

IIFE example (let --> var) #2098

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
minho-kim-uos opened this issue Sep 1, 2020 · 6 comments
Closed

IIFE example (let --> var) #2098

minho-kim-uos opened this issue Sep 1, 2020 · 6 comments

Comments

@minho-kim-uos
Copy link

Isn't it more appropriate to use "var" instead of "let" in IIFE examples to make a point?

@MuhammedZakir
Copy link
Contributor

+1! Also, I think IIFE's heading level should be H2 rather than H3.

@iliakan
Copy link
Member

iliakan commented Sep 1, 2020

You mean some place in the tutorial? Put a link here?

MuhammedZakir added a commit to MuhammedZakir/en.javascript.info that referenced this issue Sep 1, 2020
@MuhammedZakir
Copy link
Contributor

You mean some place in the tutorial? Put a link here?

This is in "The old var" chapter - https://javascript.info/var#iife. I have made some changes to this and added it in my PR #2081.

@iliakan
Copy link
Member

iliakan commented Sep 1, 2020

Can fix it there, right. @MuhammedZakir you fix that in #2081?

@minho-kim-uos
Copy link
Author

You mean some place in the tutorial? Put a link here?

This is in "The old var" chapter - https://javascript.info/var#iife. I have made some changes to this and added it in my PR #2081.

As far as I understand, the whole point of the "IIFE example" https://javascript.info/var#iife is to show that we can "emulate" the "block scope" for "var" variables.
"let" variables do not need IIFE trick.

Can fix it there, right. @MuhammedZakir you fix that in #2081?

Are we on the same page?
Can I edit the title of this issue to "let --> var"?

@MuhammedZakir
Copy link
Contributor

MuhammedZakir commented Sep 2, 2020

Can fix it there, right. @MuhammedZakir you fix that in #2081?

Yes! 69e7f6f#diff-a28a5a6e5f04ce8e5867757c61407e99L219

Are we on the same page?
Can I edit the title of this issue to "let --> var"?

You can!

MuhammedZakir added a commit to MuhammedZakir/en.javascript.info that referenced this issue Sep 2, 2020
MuhammedZakir added a commit to MuhammedZakir/en.javascript.info that referenced this issue Sep 2, 2020
MuhammedZakir added a commit to MuhammedZakir/en.javascript.info that referenced this issue Sep 2, 2020
MuhammedZakir added a commit to MuhammedZakir/en.javascript.info that referenced this issue Sep 2, 2020
@minho-kim-uos minho-kim-uos changed the title IIFE example (var --> let) IIFE example (let --> var) Sep 2, 2020
iliakan added a commit that referenced this issue Sep 12, 2020
Fix #2098 - replace let with var in IIFE example
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants