7. JavaScript Runs In A Host Environment | Complete JavaScript Tutorials

  • 4 years ago
Now the last thing we saw in the previous definition slide is that JavaScript runs on a host environment.
So that means a JavaScript engine can be part where it can be executed in different environments.
The most well known environment is the browser.
Modern browsers have Javascript engines built in and they're therefore capable of executing javascript
code but you also can run javascript in our environments.
For example on the server side so write on a computer without having a browser in between so not inside
of a browser but simply execute code like this on your machine.
Now javascript was invented to run in the browser to make Web sites more dynamic to be able to change
things on a Web site without loading a new page you could say because javascript is able to closely
work together with the loaded age HTML code with CSX.
You can also use javascript to send back ground to DP requests so to send some behind the scenes requests
and fetch data without reloading the page and much much more in it will do all of that from the course.
Now there also are certain things javascript can't do when it runs in the browser environment though.
For example it can't access your local file system for security reasons because otherwise every web
page you visit would be able to read your file system maybe delete files on your computer ends on which
would be horrible of course.
And in general it is running in an a sandbox.
You can say it's not able to interact with your operating system and so on the browser gives you certain
things you can do in this environment and doesn't allow other things.
Now it's a set the browser is only one environment though the one for which javascript was invented
but not the only one were restricted to right now.
Instead the JavaScript engine Google developed V8 is the name of the engine was extracted by some people
to run javascript anywhere because the idea was Well if we have the engine in the browser why don't
we take it out of the browser and then make it available as a standalone tool which you can use to execute
javascript anywhere else directly on your machine.
And this

Recommended