Ever tried asking Google?  “what are the most important languages for a web developer? ”. JavaScript turns out to be in the 1/3rd of the answers. Ever wondered what made JS take that place?. Here’s why.


1. What is JavaScript?

Often referred to as the language of the web, JavaScript (JS) is an object-oriented, prototyped, cross-platform, lightweight, Just-in-time complied, loosely typed, scripting language. In specific a Client side scripting language i.e it runs on the browser of the client(user) implying it doesn't need a separate compiler to run the script making it feasible with any browser irrespective of the platforms.


2. When JavaScript?

JavaScript was introduced by Netscape in 1995. It went through a series of names starting with Mocha,  LiveScript and then JavaScript. Despite having many similarities with Java, it was still given the name JavaScript just because Netscape and Sun decided on a license agreement.


3.Why JavaScript?

JavaScript is easy to learn. JavaScript can be used to program both frontend and backend of web pages, which is why the number of fans for this language has shot up since the last few years. JavaScript is fast as it doesn't need any additional compiler to run it. The javaScript files are downloaded in the user’s computer and are executed directly by the browser's interpreter. It also has a collection of amazing frameworks which make implementing a lot of things for frontend and backend much easier. Few of the frameworks are Node.js, AngularJs, React, Vue. and many more come every day!


4. Where JavaScript can be used?

As already mentioned, JavaScript though considered mostly as a client-side scripting language, also has a server side. Isn’t the thought of using the same language for both frontend and backend so comforting? Frameworks like Angular, React, Vue support the frontend while the others like Meteor and Node support backend scripting.


5. How does JavaScript work?


JavaScript is embedded with HTML either as an internal script within script tags or as an external .js file. JavaScript doesn’t need an additional compiler as a JS interpreter is already embedded with the Browser. This JS interpreter is referred to as the JavaScript Engine. Each Browser has its own JS Engine. Few of them are V8 of Google Chrome, SpiderMonkey of Mozilla and Chakra of Edge. These engines download the JavaScript code present in a human-readable format from the .js file on the user’s system, interpret it and convert it into machine code. This interpretation is also known as JIT compilation i.e Just-in-time compilation which is quick and optimized.


blog comments powered by Disqus