Skip navigation

Tag Archives: declaring

Creating variables in often referred to as “declaring” variables. var statement used to declare variables.

Interesting part is, you don’t need to declare a variable to use it. Just start using it like


After some time, you realize your mistake and redeclare it like
var age;

You may expect, now the value of age is 0 ….

But still the age is 25 !!!

age = 25;
var age;
alert(age); // 25

Above order is perfect in JavaScript.

Great POWER comes with great RESPONSIBILITY.