5. Global environment
So far, we have discussed JavaScript keywords, a few essential
functions, and the concepts of scope and environment. What is the
global environment and what does it contain? The answer depends on
the particular implementation of JavaScript.
In a browser, JavaScript runs in a restricted environment for
security reasons. Allowing JavaScript in your browser means allowing
code written in unknown locations to run in your browser and therefore
on your computer. There have been countless attacks where such code
has stolen sensitive files, sent spam, inspected a company's internal
network, or spied on other JavaScript code to find credit card numbers
or passwords. Browsers have made great efforts to limit these risks
and, as a result, provide libraries with limited functionality: it
is therefore not possible for a JavaScript program running in a browser
to read the user's...
You do not have access to this resource.
Exclusive to subscribers. 97% yet to be discovered!
Already subscribed?
Log in!
Ongoing reading
Global environment