Tutorial
Unknown Facts
🎉

Read This on Github

This article is available on Github. You can read it there and contribute to it.
Github Link
Any Issue ?

You Know I Live & Breathe JavaScript 😍

I'll take you on your journey to becoming the best JavaScript Expert and Wizard, the secret of advanced technique. And I'm 100% certain that if you follow along, You'll come out the other side with a solid understanding of this, armed with the knowledge to be a positive force in this incredible development world.

📚 History of JavaScript

Let's talk about some history of JavaScript and some facts

Small history of JavaScript

JavaScript was created by Brendan Eich in 1995. It was originally called LiveScript, but was renamed to JavaScript in 1996 because of the popularity of the Java language. It was developed for the Netscape Navigator web browser, and was first implemented in that browser in 1995 and became the ECMA-262 standard in 1997 and was standardized by ECMA International in the ECMA-262 specification. The first version of JavaScript was called ECMAScript 1. The latest version is ECMAScript 2020.The planned new release (ES6) was codenamed ES Harmony. The name was changed to ES6 to avoid confusion with the Harmony project, which was a completely different project.

The ES5 standard was released in 2009, and the majority of browsers were compliant by July 2013:

Browser & Date

Logo

Chrome 23 (Nov 2012)

IE10 / Edge 12 (Nov 2012)

Firefox 21 (May 2013)

Safari 6 (Jul 2012)

Opera 15 (Jul 2013)

ES6 was also a huge success. It was released in 2015, and all major browsers were fully compliant by March 2017:

Browser & Date

Logo

Chrome 51 (May 2016)

Edge 14 (Aug 2016)

Firefox 52 (Mar 2017)

Safari 10 (Sep 2016)

Opera 38 (Jun 2016)

📝 Facts

Fact 1

JavaScript is the most popular programming language in the world. It is used by 98.9% of the 10 million most popular websites.

Fact 2

Using JavaScript, you can create a website that is interactive and dynamic. You can also create a website that is static and non-interactive.

Fact 3

JavaScript is a client-side scripting language. It is used to create dynamic web pages. It is used to create interactive web pages. It is used to create responsive web pages. It is used to create web pages that are dynamic and interactive.

Fact 4

JavaScript is a single threaded. This means that it can only execute one statement at a time. It is a synchronous language. This is the reason lots of people who use multi-threaded programming thinks its working is slow as it would not be able to make use of all the cores of the CPU properly.

Fact 5

Like all other scripting languages, arrays and objects can be created with a brief shortcut syntax. Arrays are used to store data in a sequential manner. Objects are used to store data in a non-sequential manner.These literals structure the basis of JSON (JavaScript Object Notation) which is used to store data in a non-sequential manner.

Fact 6

There is a CSRF attack known as “JavaScript hijacking” in which a tag on an attacker’s site damages a page on the victim’s site that returns private information such as JavaScript or JSON data. This attack is possible because JavaScript is executed on the client side. This means that the attacker can send a request to the victim’s site and the victim’s site will return the data. The attacker can then use the data to perform the attack.

Fact 7

JavaScript is supported by all modern Web browsers with the built-in interpreters.

📑 Comparison

JavaScript is a programming language that is commonly used for creating interactive elements on websites. It is a high-level, interpreted language that is executed by the client, rather than the server. This means that JavaScript code can run directly in a web browser, without the need for additional tools or compilers.

Java, C++, Python, and C are all examples of programming languages that are commonly used for a wide range of purposes, including web development, app development, and software engineering. These languages are all general-purpose languages, which means that they are not specifically designed for a particular application.

Java and C++ are both compiled languages, which means that the source code must be converted into machine code before it can be executed by a computer. This can make them more efficient and faster than interpreted languages like JavaScript and Python.

Python and C are both high-level languages, which means that they are designed to be easier for humans to read and write than low-level languages like machine code. Python is an interpreted language, like JavaScript, which means that it can be run directly without the need for additional tools. C, on the other hand, is a compiled language, like Java and C++.

Here are some examples of how these languages might be used:

• JavaScript: Adding an interactive map to a website, creating a simple game or quiz

• Java: Developing a mobile app, creating a web-based application

• C++: Developing a high-performance software application, creating a video game

• Python: Processing and analyzing data, creating a simple web server

• C: Developing the operating system for a computer, creating a low-level system or application.

In terms of coding differences, one major difference between JavaScript and other languages is that JavaScript is a dynamically-typed language, while languages like Java and C++ are statically-typed languages. This means that in JavaScript, the type of a variable (e.g. string, integer, boolean) is determined at runtime, while in statically-typed languages, the type of a variable must be specified when it is declared.

Here is an example of how variable declarations might look in each of these languages:

CodeXam.js
    let x = 10;
    x = "hello";

In the JavaScript example, the type of the variable x is initially set to number, but it can be changed to a string at runtime without any issues. In the Java, C++, and C examples, the type of the variable x is explicitly set to int, so attempting to change it to a string would cause a compile-time error. In the Python example, the type of x is not explicitly specified, so it can be changed to a string without any issues.

📓 Advantages

JavaScript is a very powerful and versatile programming language that has a number of advantages, including the following:

  • JavaScript is a client-side language, which means that it is executed on the user's computer, rather than on the server. This makes it a very fast and efficient language, as the server doesn't need to process any requests in order for the code to be executed.

  • JavaScript is very easy to learn and use, and has a large and active community of developers who constantly contribute to and improve the language. This means that there is a wealth of learning resources and support available for those who are new to the language.

  • JavaScript is a very flexible language, and can be used to create a wide range of applications, from simple websites to complex web applications. This makes it a great choice for developers who want to build a variety of different types of projects.

  • JavaScript is a very popular language, and is supported by all modern web browsers. This means that any code written in JavaScript will be able to run on a wide range of devices and platforms, making it a very versatile language to work with.

📒 Disadvantages

Like any programming language, JavaScript has its own set of disadvantages that should be considered before using it for a project. Some of the main disadvantages of JavaScript include:

  • JavaScript is a client-side language, which means that the source code is visible to anyone who views the page source. This can be a security concern, as it means that sensitive information, such as passwords and authentication keys, could be exposed to potential attackers.

  • JavaScript is an interpreted language, which means that it is executed at runtime by the user's web browser. This can lead to slower execution times, compared to compiled languages, which are executed directly by the computer's processor.

  • JavaScript is a dynamically-typed language, which means that variables don't have a fixed type. This can make it more difficult to catch errors at compile time, and can lead to runtime errors that are difficult to debug.

  • JavaScript is not a very powerful language, and is not suitable for building complex, large-scale applications. For these types of projects, more powerful languages, such as Java or C++, may be a better choice.