..Sigaj JS Function
..Sigaj JS Function
Function call
“Function expression”
Local scope
Global scope (function-level
scope)
Local scope
(function-level
scope)
Global scope
Naming collision
• Two JavaScript files, both have a global variable with the same name
It’s better to avoid creating too many global variables. Use function
parameters if you need to share specific values with a function
Summer 2022 – University of Virginia © Praphamontripong 7
Howgroup
Objects dovariables
WebandApps functionsfit in with
to create a model revisit
thesomething
representing World Around
you would recognizeThem?
from the real world