An Introduction to JavaScript - LearnHowToCode SarkariResult.com Interview Questions and Answers LearnHowToCodeOnline
An Introduction to JavaScript

An Introduction to JavaScript

An Introduction to JavaScript

Let’s see what’s so special about JavaScript, what we can achieve with it and which other technologies play well with it.

What is JavaScript?

JavaScript was initially created to “make webpages alive”.
The programs in this language are called scripts. They can be written right in the HTML and execute automatically as the page loads.
Scripts are provided and executed as a plain text. They don’t need a special preparation or a compilation to run.
In this aspect, JavaScript is very different from another language called Java.
Why JavaScript?
When JavaScript was created, it initially had another name: “LiveScript”. But Java language was very popular at that time, so it was decided that positioning a new language as a “younger brother” of Java would help.
But as it evolved, JavaScript became a fully independent language, with its own specification called ECMAScript, and now it has no relation to Java at all.
At present, JavaScript can execute not only in the browser, but also on the server, or actually on any device where there exists a special program called the JavaScript engine.
The browser has an embedded engine, sometimes it’s also called a “JavaScript virtual machine”.
Different engines have different “codenames”, for example:
  • V8 – in Chrome and Opera.
  • SpiderMonkey – in Firefox.
  • …There are other codenames like “Trident”, “Chakra” for different versions of IE, “ChakraCore” for Microsoft Edge, “Nitro” and “SquirrelFish” for Safari etc.
The terms above are good to remember, because they are used in developer articles on the internet. We’ll use them too. For instance, if “a feature X is supported by V8”, then it probably works in Chrome and Opera.
How do engines work?
Engines are complicated. But the basics are easy.
  1. The engine (embedded if it’s a browser) reads (“parses”) the script.
  2. Then it converts (“compiles”) the script to the machine language.
  3. And then the machine code runs, pretty fast.
The engine applies optimizations on every stage of the process. It even watches the compiled script as it runs, analyzes the data that flows through it and applies optimizations to the machine code based on that knowledge. At the end, scripts are quite fast.

About Mariano

I'm Ethan Mariano a software engineer by profession and reader/writter by passion.I have good understanding and knowledge of AngularJS, Database, javascript, web development, digital marketing and exploring other technologies related to Software development.

0 comments:

Featured post

Political Full Forms List

Acronym Full Form MLA Member of Legislative Assembly RSS Really Simple Syndication, Rashtriya Swayamsevak Sangh UNESCO United Nations E...

Powered by Blogger.