Javascript Runtime Environment
By Saket Bhatnagar••Beginner to Intermediate
javascript runtime environment
- 1JavaScript Runtime Enviroment provides the enviroment where we can run our JavaScript code.
- 2Two javascript runtime enviroments are :
I. Browser
II. Node.js
Browser
- 1A browser is a software application that is used to access and view information on the World Wide Web (WWW).
- 2It allows users to interact with web pages, view multimedia content, and surf the internet.
- 3The Browser acts as a JavaScript runtime environment because it includes a JavaScript engine that interprets and executes JavaScript code
JavaScript engine
- 1A JavaScript engine is a computer program that executes JavaScript code.
- 2It is a core component of web browsers, server-side JavaScript platforms, and other JavaScript-based environments.
Some popular JavaScript engines include:
- 1 V8 (fastest Js engine): developed by Google, used in Google Chrome and Node.js
- 2 SpiderMonkey : developed by Mozilla, used in Firefox
- 3 JavaScriptCore : developed by Apple, used in Safari
- 4 Chakra : developed by Microsoft, used in Microsoft Edge and Internet Explorer (legacy)
Node.js
- 1The main reason of javascript popularity.
- 2Node.js is a software application that executes JavaScript code. It is not a framework or a library.
- 3It allows developers to run JavaScript code outside of a web browser, such as on a server or command-line interface.
- 4Node.js uses the V8 JavaScript engine, which is also used in Google Chrome.
- 5It is built on top of an event-driven, non-blocking I/O model, which allows it to handle large numbers of simultaneous connections without blocking the execution of other code.
- 6This makes it well-suited for building scalable, high-performance applications that can handle a large amount of traffic.
- 7Because after introduction of Nodejs, we were able to run javascript anywhere like in web servers, as command-line tools, desktop applications, and even IoT (Internet of Things) devices.