Followers

Friday, 27 June 2014

Constants and Variables

In this tutorial we will be going through Constants and Variables. So, what does they mean in programming language?

Constant is one, for which you can not change the value during the course of a program. On the other hand,
Variables can change.      

Let's go through a basic example of above mentioned terms,

Constants are declared using the keyword let





As 'count' is declared as a constant, updating the value of 'count' is going to throw an error,

 
(include expressions)



Variables are declared using the keyword var




In this case user will be able to update the value of 'count'.