Open In App

History of JavaScript

Last Updated : 15 May, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

Brendan Eich first developed JavaScript, a computer language, in about ten days in May 1995. The language, formerly known as Mocha, later modified to LiveScript, and is now known simply as JavaScript, was created to be used on the client-side of websites, enabling the addition of dynamic and interactive components to static HTML texts.

JavaScript was initially implemented in Netscape Navigator, which was the most popular browser at the time. The language was quickly adopted by Microsoft for use in Internet Explorer. Due to its simplicity of usage and the fact that it was the only client-side scripting language available at the time, JavaScript quickly gained popularity among web developers.

JavaScript gained popularity during the ensuing years and was used to develop a wide range of web applications, such as online games, dynamic menus, and form validation. ECMAScript 4, a new version of the language, was planned in 2002, however, it was ultimately abandoned because of conflicts among the various browser vendors.

With an estimated 95% of websites utilizing it in some capacity, JavaScript is currently one of the most popular programming languages in use worldwide. It is employed not only in web development but also in the creation of server-side applications, desktop and mobile applications, and even the programming of robots and other hardware.

Since it was first released in 1995, the JavaScript language has undergone a number of revisions, each of which has contributed new features and syntax. We will contrast some code from an older version with code from the most recent update in this response.

Example 1: The var keyword was first made available in 1995’s initial release of JavaScript. Declaring a variable that can later be changed in the code is done using it. Variables in JavaScript had to be declared using the let keyword, which was taken from the C programming language before var was introduced.

Two new keywords, let and const, were added to ECMAScript 6 (which was released in 2015) to give block scope variables in addition to the function scope variables offered by var. In that it permits variable reassignment, the let keyword is comparable to var in that it also offers block scoping. On the other hand, variables whose values cannot be changed are declared using the const keyword.

In older versions of JavaScript, variables were declared using the “var” keyword:

var x = 10;

Output:

 

In the latest version of JavaScript, you can also use “const” to declare variables:

Javascript




let x = 10;
const y = 20;


Output:

 

The distinction between “const” is that after a variable has been initialized, “const” cannot be used to change its value.

Example 2: Since JavaScript’s introduction in 1995, functions have been a fundamental component. Functions are objects in JavaScript that can be assigned to variables, used as arguments for other functions, and have values returned from them.

The function keyword, the function name, and a pair of brackets holding any function arguments were initially used to define JavaScript functions.

Functions were declared in earlier iterations of JavaScript using the “function” keyword:

Javascript




function add(a, b) {
      return a + b;
}


Output:

 

A number of new function-related features, such as arrow functions, default parameter values, and rest parameters, were added to ECMAScript 6 in 2015. When working with functions that take a single argument, arrow functions offer a more compact syntax for writing functions.

The most recent version of JavaScript allows you to declare functions using arrow functions:

Javascript




const sum = (c, d) => c + d;


Output:

 

Arrow functions are more concise and easier to read, especially when the function body is just a single statement.

Conclusion: In conclusion we can say, the initial version of JavaScript was released in 1995, marking the beginning of a lengthy and intricate history. With the creation of fresh features and language changes, JavaScript has substantially improved and changed throughout time. The ability to construct dynamic, interactive websites and web apps with JavaScript has made it a crucial part of web development. With the emergence of tools like Node.js, which let programmers utilize JavaScript for server-side programming, it has also spread outside of the web. JavaScript is one of the most widely used programming languages in use today, and a large and vibrant developer community actively contributes to its continued growth and advancement.



Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads