Variable Scope Basics in JavaScript

by kirupa | 20 February 2014

Let's revisit something relating to variables. Each variable you declare has a certain level of visibility that determines when you can actually use it. In human-understandable terms, what this means is simple. Just because you declare a variable doesn't mean that it can be accessed from anywhere in your code. There are some basic things you need to understand, and this whole area of understanding this falls under a topic known as variable scope.

This is a companion discussion topic for the original entry at
1 Like

I love your entire blog!!!. I discovered your site just a day ago and I’ve read over ten articles. I like how all your articles are really over simplified and straight to the point.

Hi @linda_ikechukwu - welcome to the forums and thanks for the nice comments. Glad you like the articles and the style of presenting the content :slight_smile: