JAVASCRIPT AND ITS USE CASES

Manav Misra
7 min readJun 20, 2021

What is JavaScript?

JavaScript is a text-based programming language used both on the client-side and server-side that allows you to make web pages interactive. Where HTML and CSS are languages that give structure and style to web pages, JavaScript gives web pages interactive elements that engage a user. Common examples of JavaScript that you might use every day include the search box on Amazon, a news recap video embedded on The New York Times, or refreshing your Twitter feed.

Incorporating JavaScript improves the user experience of the web page by converting it from a static page into an interactive one. To recap, JavaScript adds behavior to web pages.

What is JavaScript used for?

JavaScript is mainly used for web-based applications and web browsers. But JavaScript is also used beyond the Web in software, servers and embedded hardware controls. Here are some basic things JavaScript is used for:

1. Adding interactive behavior to web pages

JavaScript allows users to interact with web pages. There are almost no limits to the things you can do with JavaScript on a web page — these are just a few examples:

  • Show or hide more information with the click of a button
  • Change the color of a button when the mouse hovers over it
  • Slide through a carousel of images on the homepage
  • Zooming in or zooming out on an image
  • Displaying a timer or count-down on a website
  • Playing audio and video in a web page
  • Displaying animations
  • Using a drop-down hamburger menu

2. Creating web and mobile apps

Developers can use various JavaScript frameworks for developing and building web and mobile apps. JavaScript frameworks are collections of JavaScript code libraries that provide developers with pre-written code to use for routine programming features and tasks — literally a framework to build websites or web applications around.

Popular JavaScript front-end frameworks include React, React Native, Angular, and Vue. Many companies use Node.js, a JavaScript runtime environment built on Google Chrome’s JavaScript V8 engine. A few famous examples include Paypal, LinkedIn, Netflix, and Uber!

3. Building web servers and developing server applications

Beyond websites and apps, developers can also use JavaScript to build simple web servers and develop the back-end infrastructure using Node.js.

4. Game development

Of course, you can also use JavaScript to create browser games. These are a great way for beginning developers to practice their JavaScript skills.

Why use JavaScript over other programming languages?

Aside from the unlimited possibilities, there are many reasons for web developers to use JavaScript over other programming languages:

  • JavaScript is the only programming language native to the web browser
  • JavaScript is the most popular language
  • There’s a low threshold to get started
  • It’s a fun language to learn

WHAT IS NODE JS?

Node.JS is an open-source JavaScript server environment that runs the JavaScript code on the server-side.

Node.JS is ideal for fast, lightweight, real-time web applications such as audio/video streaming, browser games, chats, collaboration tools social media, time trackers, and much more. For this reason, many companies decide to use Node.js in production.

World-Renowned Companies that use Node.JS.

Netflix

Netflix is the world’s supplier of flowing broadcast and television. Netflix is the world’s top supplier of flowing broadcast and television. The company decided to embrace fast and easy Node.JS.

Earlier, Netflix was using Java on the back end and JavaScript on the front end, which required the developers to be proficient with languages.

As a result, they had to do double work for error handling, activity tracking, and debugging.

Netflix is now among companies using Node.JS due to the following reasons:

  • A common language both for the server-side and browser side.
  • High performance — now the page loads within seconds.
  • A great number of modules and their open source nature.
  • An easy way of writing, debugging, and engineering the API.

Trello

Trello is a project management tool trusted by 25 million people worldwide. It needs to rely on event-driven technology that can handle many open connections at a time. Trello is among companies that use Node.js for its server-side and as a prototyping tool to build a single-page web application.

The server side was built with Node.js. Node.js was helpful when the company was templating a tool for a one-page application. By the time the company had finished the prototype, they decided to stick with Node also at the server side of the application.

PayPal

The world’s most popular online payment system is actually one of the first companies that use Node.JS in production.

Just like Netflix, they were initially using Java on the back end and JavaScript on the front end. To test the technology, PayPal first tried to develop a prototype with two developer teams that were using Node.JS and Java, accordingly. The company assigned the Java development to a team of 5 developers and Node development to a team of 2 developers.

As a result, the Node team quickly caught up with the Java team, despite being smaller in size.

LinkedIn

This professional networking platform is also among websites using Node.JS.

The server side of the LinkedIn mobile app was built by using Node.JS. They actually moved the back end of the mobile application from Ruby on Rails to Node. Two key reasons for this switch were efficient performance and scalability.

The Ruby on Rails app was a synchronous app that the clients used to make several calls for a single page. All of the calls occurred sequentially, with each thread handling a single request.

Node.JS allowed LinkedIn developers to move to an asynchronous event system where the client made a single request per page.

The result is as follows:

  • The company now uses 4 servers instead of 15.
  • The traffic capacity has doubled.
  • On the client side, the app works 2 to 10 times faster.

Walmart

The retail giant has also benefited from the asynchronous mechanism of Node in its mobile app. Walmart can now deliver some very sophisticated features to mobile users and thus save them lots of time by customizing the content based on device type and browser capabilities.

Besides, many e-commerce systems at Walmart are powered by Node, serving millions of users without the downtimes at peak days such as the Black Friday.

Developers at Walmart can now create new APIs for Walmart apps and deploy them within hours, thus significantly reducing the release times.

Uber

Uber’s matching system creates an enormous amount of supply notifications for drivers and demand requests for passengers. Besides, a ride request helps to choose the driver through the matchmaking process.

The drivers are stored in a geospatial database that is continuously updated by each active driver on the network as they move around the city.

Uber needed a system to be reliable both to passengers and drivers and named the 3 key reasons for choosing Node.JS:

  • ability to process big amounts of data quickly and reliably,
  • convenient error analysis and quick code deployment,
  • ongoing improvement of the technology because of the open source community.

As a result, Uber now can process over 2 million remote procedure calls (RPCs) per second.

Conclusion

JavaScript is a wonderful technology to use on the web. It is not that hard to learn and it is very versatile. It plays nicely with other web technologies — such as HTML and CSS — and can even interact with plugins such as Flash. JavaScript allows us to build highly responsive user interfaces, prevent frustrating page reloads, and even fix support issues for CSS. Using the right browser add-ons (such as Google Gears or Yahoo Browser Plus) you can even use JavaScript to make online systems available offline and sync automatically once the computer goes online.

JavaScript is also not restricted to browsers. The speed and small memory footprint of JavaScript in comparison to other languages brings up more and more uses for it — from automating repetitive tasks in programs like Illustrator, up to using it as a server-side language with a standalone parser. The future is wide open.

You can also follow me on my linked in profile by clicking on following link.

--

--