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

Global Variable. #10

Open
adityathebe opened this issue Jul 22, 2015 · 1 comment
Open

Global Variable. #10

adityathebe opened this issue Jul 22, 2015 · 1 comment

Comments

@adityathebe
Copy link

I see that we need to declare the variable "i" in the for loop using the keyword "var". example
for ( var i = 0 ; i <scores.length ; i++)

As I have learned in the previous lessons that if I don't declare a variable inside a function it becomes a global variable. What if I don't write var in front of i? Does that make it a global variable??

@bethrobson
Copy link
Owner

Yes, it does!

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