JavaScript global variables and local variables
Global variables:
# Variables that can be used anywhere on the web page (inside and outside functions) are "global variables" variable".
Variables defined outside the function are "global variables".
Global variables" can be used outside the function or inside the function.
"Global variables" are used when the web page is closed. Automatically disappear (release space)
##Local variables:
- can only be used in functions. Variables used internally are called "local variables". ## "Local variables" are defined inside the function and used inside the function. "Local variables" cannot be accessed outside the function.
- ##"Local variables" disappear after the function is executed. #