Introduction To JavaScript


History of JavaScript: How It All Began
In the early 1990s, the internet was rapidly growing, and websites were mostly static, built using only HTML and CSS. There was a need for a scripting language that could make web pages interactive. This led to the creation of JavaScript.
Who Created JavaScript?
JavaScript was created by Brendan Eich, a programmer at Netscape Communications Corporation, in 1995. Netscape wanted a lightweight scripting language to enhance web pages, making them dynamic and interactive.
How Many Days Did It Take to Build JavaScript?
Surprisingly, Brendan Eich developed the first version of JavaScript in just 10 days! Netscape needed a scripting language quickly, and Eich was tasked with designing it within a tight deadline. The first version was called Mocha, then renamed LiveScript, and finally rebranded as JavaScript for marketing reasons.
Who Set the Rules for JavaScript?
As JavaScript gained popularity, ECMAScript (ES) was established as its official standard in 1997 by ECMA International (European Computer Manufacturers Association). This was done to ensure consistency across different browsers.
The first standard, ECMAScript 1 (ES1), was released in 1997, and over the years, JavaScript has evolved with major updates like ES6 (2015), which introduced features like arrow functions, let
and const
, and template literals.
Where and How to Add JavaScript in an HTML Page?
What the
<script>
tag does – It allows JavaScript code to run inside an HTML page.Where to place the
<script>
tag – Inside the<head>
or before the closing</body>
tag.Differences between
<script>
in<head>
vs.<body>
If placed in
<head>
, it may delay rendering because the script loads before the content.If placed before
</body>
, it ensures the HTML loads first, improving performance and efficiency.
It is the best practice to place the script tag at the end of the body in html page.
JavaScript and Node.js: Understanding the Connection
JavaScript was originally built for the browser to create dynamic web pages.
Node.js is a runtime environment which extracts the JS engine and allows JavaScript to run outside the browser (on our local machines,on servers, command-line tools, etc.).
Node.js is built on Chrome's V8 engine, which executes JavaScript code efficiently.
Key benefits of Node.js:
Enables backend development with JavaScript.
Supports asynchronous, event-driven programming.
Allows full-stack development with a single language.
How they work together:
- JavaScript is the language, and Node.js provides an environment to run JavaScript on a server.
Subscribe to my newsletter
Read articles from Raveena Putta directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
