Variable: var
As promised on my phase 1 blog, i will be back with more. Well, after repeating my first phase, which i am glad i did, because it helped me emphasis my knowledge on Javascript fundamentals. Now that i am done with phase 1, here i am working on my last week of phase 2 which consists of React. More on React some other time.

creating a variable
var is short for variable and is a pre-ES6 way of declaring a variable. ES6 keyword to declare a variable are const and let. Nevertheless, it is good to familiarize ourselves with pre-ES6 because tons of codes were written using var.
var is a keyword that tells Javascript you are declaring a variable
Example
var favoriteColor=”red”
var 8 =”twitter”. // variable name cannot start with numbers
In the example above, favoriteColor is the variable name, red is the value assigned to the variable favoriteColor, the = sign is the assignment operator. When declaring a variable, we must use the standard convention in Javascript camelCasing (favoriteFood) and remember, variable name cannot start with numbers.
Re-declare, Re-assign
var can be re-declared or updated.
Example
var favoriteColor =”red”
var favoriteColor =”yellow” //re-declare
favoriteColor=”yellow” //re-assign
var favoriteColor; // not assigned a value. In this case the variable will automatically be given a value of undefined
The reason var was let go and const and let was introduced is because var will likely cause a lot of bugs in the code. Again, familiarize yourself with it and stay tuned for more.