JavaScript was initially created to make web pages alive by handling interaction and DOM manipulation.
Initially, JavaScript was created to run only inside browsers.
Each browser has its own JavaScript engine that converts high-level JS to machine code to execute code.
Different browsers have different JS engines:
Later, this engine was carved out for server-side use, enabling JavaScript outside browsers.
The power of JavaScript depends on the environment: browser JavaScript and server JavaScript.
Browser JavaScript does not provide low-level access to memory or the CPU, because it was initially created for browsers which do not require it.
In browser JavaScript can handle webpage manipulation, user interactions, cookies, local storage, and webserver communication.
Send requests over the network to remote servers, download and upload files (AJAX and COMET technologies).
Browser JavaScript has limits to keep users safe from harmful webpages stealing data or causing damage.
JavaScript cannot read or write files on the hard drive. It has no direct access to computer functions.
Browsers let it handle files only if you choose them—like dragging a file or picking one with an input button.
It cannot access camera, microphone, or other devices without clear permission. A webpage cannot secretly turn on your webcam and spy.
Different tabs or windows usually cannot see each other. Even if one opens another, they cannot share data if from different sites (this is the Same Origin Policy).
Three big strengths:
No other browser technology combines all three. That's why JavaScript dominates web interfaces.