Understanding JavaScript

Understanding JavaScript

Let's learn about the most popular and widely used scripting language for the web, JavaScript.

The Targeted audience for this article is as follows;

  • Newbies to coding

  • Javascript beginners

  • Experienced developers

Let's start with the fundamentals of javascript. Basics are the most important thing to learn in everything you learn because every other thing depends on the basics. The basic knowledge you should first have before learning javascript is a good knowledge of HTML and CSS. You will need this knowledge all the time as you will be dealing with calling classes and IDs.

What is JaavaScript?

From the MDN documentation, JavaScript is a lightweight, interpreted or just-in-time compiled programming language with first-class functions. Javascript is known as the scripting language for web pages.

What does JavaScript do?

First, let's understand Client-side and Server-side. For all web apps, there are two main sides, the client side called Front-end and the server side called Back-end. You are reading this article with your mobile device or on your computer, you are the client and therefore using the client side. you have nothing much to do other than just visit the page and choose what you want to read, click and it displays the information for you. There is another part that handles the job of making sure that all your requests are presented to you just the way you want them and that is the server side, it is the engine house of the web, and it handles all the requests from the client side. So how the web work is simple, when a request is made from the client side, a request is when you want to visit a web page and you type in the website URL in your browser, the request is sent to the server side through a transport system or a protocol called the HTTP protocol. The server receives the request, handles it and returns the search result to the client through the same protocol. Everything displayed on the user side is made possible from the server side(back end). This is where functionalities are added through endpoints. So, the server side is a group of computers connected to handle requests from the client side through the HTTP protocol.

HTML and CSS are used to build and design/style a web page while javaScript adds functions and user interactions to the web page. When you click a button and an event happens, that's JavaScript, when you click the follow button and you begin to follow me, that's JavaScript (you can try it to see). in simple terms, the follow button is created using the HTML button tag, it is colored and styled using CSS and functions and user interaction is added to it using JavaScript, without javascript, the button will still look as good as it is but when you click on it nothing will happen.

HMTL, CSS and Javascript are the essential building block of all web pages.

You would find the usage of javascript in most of the popular frameworks such as React, Angular and Vue. to make the development of websites faster. Node.js uses JavaScript for creating API on the server side for handling requests. React and ionic are the javascript framework for creating hybrid mobile apps.

Note: Java and Javascript are not related in any way. See these two as Car and Carpet.

Do we need to install SDK to run Javascript just like python or Node.js?

The answer is No. Every browser comes with the runtime environment for javascript. this is made possible by the ECMA standardization. Here is the runtime environment for different browsers;

  • Chrome is V8

  • Edge is Chakra

  • Firefox is Spider Monkey

The ECMAScript ensures that a javascript code when run in any browser produces the same result irrespective of the browser used.

My best IDE for coding javascript is VsCode because of its too many features and extensions. Please install VsCode for our next article to start learning Javascript.