Yes, you're right. var has function scope, not global at all. When you declare var into curly braces you can access the variable outside the block code, and it could be misunderstood. But definitely, it's FUNCTION SCOPE.
I think I need another post to explain differences between arrow and normal funtions.
Thanks for your feedback. I really appreciate it.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hi, Roman.
Yes, you're right. var has function scope, not global at all. When you declare var into curly braces you can access the variable outside the block code, and it could be misunderstood. But definitely, it's FUNCTION SCOPE.
I think I need another post to explain differences between arrow and normal funtions.
Thanks for your feedback. I really appreciate it.