Skip to content
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

A bit confused after 1. Scopes #12

Open
akiraspeirs opened this issue Aug 3, 2015 · 2 comments
Open

A bit confused after 1. Scopes #12

akiraspeirs opened this issue Aug 3, 2015 · 2 comments

Comments

@akiraspeirs
Copy link

Hi,

I found some parts of the 1. Scopes exercise a bit confusing. I finished the exercise thinking that let and const could only be used in block scopes, and not in lexical scopes. I now know this is wrong on more than one level.

Also I was thrown off by the footnote This workshop will concentrate only on Lexical Scoping. After reading the footnote I reached a section called "Block Scopes", and was wondering if there was a type of block scope that was a lexical scope.

This could all just be me, but I thought it was worth mentioning.

Thanks for the workshop :)

@jesstelford
Copy link
Collaborator

Excellent feedback - thanks for taking the time :)

There is certainly a need to clarify the terminology used, and to bring some more coherence to the points explained in each lesson. There is also an open ticket for clarifying the difference between function vs lexical scope, which goes in hand with the differences between block and function. See #8.

As you've progressed through the lessons, did you find the confusion was cleared up? Is there something from later lessons that could be moved earlier to help?

Keep the great feedback coming, and please feel free to make a Pull Request with any changes you feel appropriate :)

@akiraspeirs
Copy link
Author

The workshop was great, I enjoyed it and I think it clarified the concepts for me.

Are the following points correct? If they are, I feel like they're bits worth highlighting for someone like me:

  • Javascript variables are only scoped within functions before ES6, which is different to most programming languages.
  • Since ES6 Javascript variables can be scoped within any code block, but only if they are declared with let or const.
  • ES6 isn't available in most browsers by default so the tutorial will concentrate on scopes within functions.

I just read through the other issue and it seems to cover things in much greater detail. I should have checked that out first! Please feel free to close this one.

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

2 participants