explaining the usecase of javascript in any of industries.

K.S.L.K.Harini
4 min readJun 25, 2021

JavaScript is a programming language used primarily by Web browsers to create a dynamic and interactive experience for the user. Most of the functions and applications that make the Internet indispensable to modern life are coded in some form of JavaScript.

The earliest incarnations of JavaScript were developed in the late 1990s for the Netscape Navigator Web browser. At the time, Web pages were static, offering little user interaction beyond clicking links and loading new pages. For the first time, JavaScript enabled animation, adaptive content and form validation on the page.

How does JavaScipt work?

JavaScript is what is known as a client-side script. Most Web applications, such as a search engine, work because of an interaction between the user’s device (e.g. computer, phone or tablet) and a remote server. The software on the remote server sends information to the client (i.e. the user’s machine) and the software on the client side reads the information and renders a Web page on screen.

A client-side script is a programming language that performs its tasks entirely on the client’s machine and does not need to interact with the server to function. For instance, if you have a Web page loaded on your computer and your Internet service provider goes down, you are still able to interact with the Web pages already loaded on your browser. You will not, however, be able to navigate to new Web pages or access any data located remotely.

Some of the dynamic website enhancements performed by JavaScript are:

  • Autocomplete
  • Loading new content or data onto the page without reloading the page
  • Rollover effects and dropdown menus
  • Animating page elements such as fading, resizing or relocating
  • Playing audio and video
  • Validating input from Web forms
  • Repairing browser compatibility issues

While JavaScript is a client-side language, some of its most powerful features involve asynchronous interaction with a remote server. Asynchronous simply means that JavaScript is able to communicate with the server in the background without interrupting the user interaction taking place in the foreground.

Take a search engine for example. Today, search engines almost all have an autocomplete function. The user begins typing a word into the search box and a list of possible search terms or phrases appears below. The experience is seamless. Suggested search terms appear without reloading the page.

In the background, JavaScript reads the letters as the user types, sends those letters to a remote server and the server sends suggestions back.

The software on the server side analyzes the words and runs algorithms to anticipate the user’s search term. Such programs are diabolically large and complex. The JavaScript on the client’s machine is as simple and small as possible so as not to slow down the user’s interaction. The communication between JavaScript and the server-side program is limited by the user’s bandwidth. This is why developers prioritize efficiency in JavaScript functions and make the amount of data communicated between the programs as small as possible.

Only once the user selects a search term does the entire page reload and produce the search results. Engines such as Google have reduced or eliminated the need to reload, even for that step. They simply produce results using the same asynchronous process.

1. Websites

JavaScript lets you add behavior to the web page where the page responds to actions without loading a new page to request processing. It enables the website to interact with visitors and execute complex actions.

2. Web Applications

As browsers and personal computers have continued to improve, JavaScript gained the ability to create robust web applications. Consider applications like Google Maps. If you want to explore a map in Google Maps, all you have to do is click and drag with the mouse. You will see the part of the map that is less detailed and then fills itself in. That’s the work of JavaScript behind the scene.

3. Presentations

A very popular use of JavaScript is to create presentations as websites. Using the Reveal.js framework, this becomes really easy if you are familiar with HTML and CSS.

4. Server Applications

With the advent of Node.js a few years ago, JavaScript made its way from the browser into the server. Since then Node is adopted by major companies such as Wal-Mart, as a key part of back end infrastructure.

5. Web Servers

You can create much more robust servers using Node or the standard server application framework Express.js. Many of the previously mentioned Nodes are actually built using MEAN stack (Mongo Express Angular Node) of which Express is the key component.

6. Games

While the browser hasn’t been the traditional games platform in the past, recently it has become robust for games. Additionally, with the addition of HTML5 canvas, the level of complexity that is possible in the browser-based games has increased exponentially. There are even browser games that teach us programming.

--

--