06 Functions
06 Functions
• global in scope
• variables declared outside of functions
• they can be used or changed anywhere in the program
• Variable is global if declared within a function unless it is
declared within a function with the var keyword.
•local in scope
• variable can be used only within the function
where it is defined and is no longer visible once
the function ends
• Functions can return values with a return statement.