# Variable Scope Basics in JavaScript

**URL:** https://forum.kirupa.com/t/variable-scope-basics-in-javascript/352579
**Category:** programming
**Created:** [November 23, 2014, 9:44am UTC](https://forum.kirupa.com/t/variable-scope-basics-in-javascript/352579 "2014-11-23T09:44:00Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![kirupa](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kirupa/32/11616_2.png) [@kirupa](https://forum.kirupa.com/u/kirupa)
#### Post date: [November 23, 2014, 9:44am UTC](https://forum.kirupa.com/t/variable-scope-basics-in-javascript/352579/1 "2014-11-23T09:44:01Z")

</div>

by [kirupa](http://www.kirupa.com/me/index.htm) | 20 February 2014

Let's revisit something relating to [variables](http://www.kirupa.com/html5/variables_in_javascript.htm). 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 [http://www.kirupa.com/html5/variable\_scope\_js.htm](http://www.kirupa.com/html5/variable_scope_js.htm)

---

<div class="post-metadata">

### Author: ![linda\_ikechukwu](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/linda_ikechukwu/32/11994_2.png) [@linda\_ikechukwu](https://forum.kirupa.com/u/linda_ikechukwu)
#### Post date: [July 1, 2020, 4:38am UTC](https://forum.kirupa.com/t/variable-scope-basics-in-javascript/352579/2 "2020-07-01T04:38:47Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![kirupa](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kirupa/32/11616_2.png) [@kirupa](https://forum.kirupa.com/u/kirupa)
#### Post date: [July 1, 2020, 7:14am UTC](https://forum.kirupa.com/t/variable-scope-basics-in-javascript/352579/3 "2020-07-01T07:14:41Z")

</div>

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 🙂
