Javascript variables

A variable is an identifier for a value.  We use variables to store values.  A variable can be a username, an address and it should be meaningfull.  We can say variables are containers that store values.  

As a good rule of thumb, it is recommended you name your variables using the English Alphabet (A-Z), avoid the use of numbers, and use camelCasing for multiple word variables.

We can use either 'var' or 'let'  to declare variables.  'var' is less recommended and it is better to use 'let' to declare variables.

for example:-

let username='John Doe';

Variables created with the keyword const  are as the name shows , constant, meaning that they can not be overwritten.  By using const , we can make sure that the value of the variable can not be chagned once we initialize it.  If you don't what to re-assign a variable, const is the right choice.

const Rate=4.52;

We can not change the value of Rate to something other than 4.52.

Note: - Variable names have a strict set of rules. You must not pick a variable name that is a keyword  or a reserved word.

Refer the list of words which cannot be used as variable names

Reserved keywords

Reserved Keywords in Javascript

debugger 
default
delete
do
else
enum
export
extends
false
finally
for
function
if
implements
import
in
Infinity
instanceof
interface
let
NaN
new
null
package
private
protected
public
return
static
super
switch
this
throw
true
try
typeof
undefined
var
void
while
with
yield