Table of contents
What is Javascript
Javascript is a scripting or programming language that allows you to implement complex features on web pages. Javascript was initially created to "Make web pages". The Programs in this language are called scripts they can be written right in a web Page's HTML and run automatically as the page loads.
scripts are provided and executed as plain text. They don't need special preparation or compilation to run. Today, Javascript can execute not only in the browser, but also on the server, or actually on any device that has a special program called the "Javascript Virtual Machine".
Different engines have a different name
Ex:- V8 - in Chrome, Opera and Edge
SpiderMonkey - In Firefox
How Engines Work:-
It's complicated but in short.
1. The engine (embedded if its browser reads "Psrse's) the script.
2. Then it converts ("compiles") the script to machine code.
3. Then machine code runs Pretty fast.
What can in-browser JavaScript do?
Modern JavaScript is a “safe” programming language. It does not provide low-level access to memory or the CPU, because it was initially created for browsers that do not require it.
JavaScript’s capabilities greatly depend on the environment it’s running in. For instance, Node.js supports functions that allow JavaScript to read/write arbitrary files, perform network requests, etc.
in-browser JavaScript can:
Add new HTML to the page, change the existing content, and modify styles.
React to user actions, run on mouse clicks, pointer movements, and key presses.
Send requests over the network to remote servers, download and upload files (so-called AJAX and COMET technologies).
Get and set cookies, ask questions to the visitor, and show messages.
Remember the data on the client side (“local storage”).
Javascript is the best language for web developers we can use Javascript for frontend and also in the backend
Prerequisites: Basic Computer literacy, a basic understanding of HTML, and css