Local and global variables in javascript
In JavaScript there are 2 types of variables 1. Local variables 2. Global variables JavaScript local variables : Local variables are the variables declared with in a function. These variables have local scope meaning these are available only inside the function that contains them.