Introduction to JavaScript
A beginner friendly introduction to the most in demand language in recent times - JavaScript.
Table of contents
The worldwide web is more than 30 years old, however, the internet is even older. But, in reality, the internet and the web is getting younger by the day as both computational power and networks get better and better.
In the early 2000s, the web was mostly made up of documents that contained only text and images. But, ever since then we have come a long way as you can see web applications nowadays are better at serving your needs very easily.
Web Browsers are great platforms upon which great products and services are built. They have become better and stronger over the years.
In the end, it all boils down to our three musketeers, i.e., HTML, CSS and JavaScript when you talk about websites and web applications.
Let me give you an analogy to understand. Let's consider a car as our analogy.
HTML
HTML stands for Hyper-Text Markup Language. It is not a programming language rather it is a Markup language and is used in building layouts and elements such as text, images, list, tables and many more.
You can consider HTML as a inner body of a car, as shown below.
CSS
CSS stands for Cascading Style Sheet. As from the name you might have guessed, it is to give style to the HTML elements, so that it looks visually appealing.
You can consider CSS as the outer body of a car, as shown below.
JavaScript
JavaScript is a language of the browsers. Without JavaScript you cannot create any web applications. It provides interactivity that turns a document into a web application.
You can consider JavaScript as the engine of a car, as show below.
The combination of these 3 is what makes a basic web application. Now, lets talk about JavaScript more.
Brief History of JavaScript
Spoiler Alert: This is the start of Web 2.0.
In the early 90's, the need was felt to add interactivity with the web page. Around same time, Java was popular and was coming up in big way. Java had became too big of a language to add interactivity to the web page and was an overkill for web designers and amateur developers.
There was a most popular web browser called Netscape Communicator. They were looking for a light-weight scripting language for the web which could be used for interactivity and manipulating contents of the web page dynamically.
In the mid 1995, Netscape hired a programmer who was specialized in languages called Brendan Eich. Within 2 weeks he created a language called Mocha, which later became JavaScript.
Mocha made its debut in Netscape Communicator in the May of 1995. It was later named to LiveScript due to some marketing purposes.
In December 1995, Netscape Communicator and Sun joined hands, and LiveScript was renamed to JavaScript to make it sound like a younger cousin of Java, which adds interactive features to HTML.
In 1996, a need for JavaScript to be turned into formal standard was found, to set the standards and ensure that the implementation should follow certain guidelines and goals.
To make this happen, ECMA (European Computer Manufacturers Association) was approached. ECMA gave an official code number to JavaScript, ECMA-262. A committee was also created called TC-39 (Technical Committee no. 39), to look over any future changes to the language.
Since JavaScript, the name was trademark by the company Sun Microsystems. The name ECMAScript was given to the refer to the language standards or rather versions.
You can read more on its official website :- TC-39
Your first Script
Download a code Editor/an IDE of your choice. I am using VS Code (Recommended). you can refer this article for VS Code setup :- Setup
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Javascript</title>
</head>
<body>
<script>
console.log("Hello Word!")
</script>
</body>
</html>
Start the live server and Ctrl + Shift + I
on the web page, you can check it console section of the Inspect element. Yay! you wrote your first JavaScript code.
This was all from my side.
Hope It was helpful.
Stay Tuned for more.
Thank you.