DEV Community

Cover image for Java Script - Part I
SIYUM
SIYUM

Posted on

Java Script - Part I

Java Script, Java Script, Java Script everywhere, If you see here it is JS, If you see there will be JS. So what is really JS? In this article we are going to deep dive into what is JS. This is the part 1 of my JS series.

What is JS.

JavaScript is a scripting or programming language that allows you to implement complex features on web pages — every time a web page does more than just sit there and display static information for you to look at — displaying timely content updates, interactive maps, animated 2D/3D graphics, scrolling video jukeboxes, etc. — you can bet that JavaScript is probably involved. -MDN

In the MDN, they are mentioning that JS is a scripting language, which is programming language that employs a high-level construct to interpret and execute one command at a time. We are mostly using JS for our day to day life, even now you are using JS. JS is used to update the content of the we dynamically.

History of JS

JavaScript was invented by Brendan Eich in 1995.

It was developed for Netscape 2, and became the ECMA-262 standard in 1997.

After Netscape handed JavaScript over to ECMA, the Mozilla foundation continued to develop JavaScript for the Firefox browser. Mozilla's latest version was 1.8.5. (Identical to ES5).

Internet Explorer (IE4) was the first browser to support ECMA-262 Edition 1 (ES1).

History in brief

Image description

Fun fact - JS is developed in 10 days 😅

How JS is working

Image description

Step 1 - Parser

  • In this step we are checking line by line for the syntax errors. It throws a kind of error and stops execution of the code

Step 2 - AST

  • Once Parser is completed it's task, it will create a data structure called AST. (it stands for Abstract Syntax Tree)

Step 3 - Converting to Machine Code

  • Once the Abstract Syntax Tree is created by the parser, the JavaScript engine converts the JavaScript code into the machine code (or in the language that machine can understand).

Step 4 - Machine code

  • When the program written in the JavaScript gets converted in the machine language (or in byte code), the converted code is sent to the system for execution, and finally, that byte code run by the system/engine just like we observe in our first example.

That's end of the today's article. Let's meet next week.

Top comments (0)