Global variables can be accessed from any location in the script, whereas local variables can
be accessed only within the function.
1- Global Variable
Those variables that can be accessed from any location in the script are called global variables.
2- Local Variable
Those variables that can't be accessed from any location and can be accessed within the function are called local variables.
Variable Declaration Syntax
Variables declare with keyword ' var
E.g var a;
Output: Sum of Two number is: 16