Skip to main content

JavaScript Intro

Now you have covered Html, and CSS. This is the last part of this documentation which is JavaScript. You have seen how you can present your web pages using CSS but you can add even more functionalities using JavaScript.

JavaScript is a programming language used in building dynamic applications. Html and CSS create static sites but JavaScript has the performance functionality that powers up a site.

In this doc section, you will cover the basic features of JavaScript, the DOM, JavaScript functions, loops and wrap it up with some projects.

But before all that, you will learn about the history of JavaScript.

History of JavaScript

In 1995, Brendan Eich created a programming language within 10 days for Netscape, the company he worked for. They named it Mocha but afterwards, they changed the name to LiveScript. Then, the Java programming language was gaining widespread popularity among developers. So Netscape decided to change it to JavaScript to gain popularity among developers.

The language was changed successfully to JavaScript after the owners of Java had given Netscape the permission to.

That name stuck to the language eventually, even though JavaScript has evolved to different versions supported by different browsers.

It has also led many people, especially newbie developers, to think JavaScript and Java are similar. But, JavaScript and Java are not similar at all. JavaScript has more in common with C++ than it does with Java.

Netscape gave the ECMA International Organization the rights to maintain and promote the language many years ago. The organisation then changed the name to ECMAScript but the name JavaScript has become attached to the language that it is still known as JavaScript.

The ECMA body releases updates every year but they are mainly minor updates. The ECMAScript 2009 and 2015 also known as ES5 and ES6 were major updates to the language syntax and semantics.

Some key points about JavaScript

JavaScript is loosely-typed. Most developers coming from languages such as Java, C would always find the language somewhat annoying.

This is because unlike those languages, JavaScript would almost parse every data type as the same. In languages like Java or even C++ you would need to define data types and you could only use data types that are similar or declare those data types before using them.

But in Javascript, you do not need to do that. That is why you could type this in Javascript without getting an error.

js

5 + "5"
>>> 55

Those languages I mentioned would give an error if you typed this because you are trying to add an integer value to a string.

You will learn about data types in Javascript in this section. This was just to give you an insight on the flaws of JavaScript.

JavaScript has grown to a powerful language and many developers' favourite because of its many features. It has many frameworks which you could use to build full stack applications such as React, Express js, Node js and so on. You could also use JavaScript in machine learning and other diverse tech fields.

With JavaScript you could do so many things because of its uses in many career fields. This doc will cover vanilla JavaScript which is the "original javascript". I call it "original javascript" because it covers the syntax and semantics of the language. With vanilla JavaScript, you could build dynamic applications and also solidify your understanding of JavaScript before moving on the framework of your choice.