You would have heard about Javascript if you’re a developer or aspiring to be one. Javascript is being used by 95% of the websites in use today.
Javascript has a monopoly on the web. If you want to build something on the web, you’ll use Javascript at some point.
According to Github’s Octoverse 2021 report, Javascript is consistently the most popular language since 2014.
In this week’s post, We’ll see what made Javascript so popular and why it is beneficial if you know Javascript.
1. Getting started easily
Javascript is a beginner-friendly language. Unlike many other programming languages, you need not download resources from the internet and configure your machine to work with Javascript.
If you have a browser, you can immediately start writing Javascript code.
Every browser supports Javascript!
Why don’t we do it now? Let’s write our first Javascript “Hello world” code in 2 minutes.
Open your browser (like Chrome).
Open developer console. You can also use Option + ⌘ + J (on macOS), or Shift + CTRL + J (on Windows/Linux).
Type the following code.
console.log("Hello World!");
Press Enter.
That’s it! The console prints “Hello World!”.
This ease of setup helps beginners to get started with Javascript quickly. You can also download a code editor like Visual Studio Code or Atom and directly start coding by creating a file with “.js” extension.
Javascript is versatile
Most languages are domain-specific. For example, Java and Go are great languages used for server-side development and not front-end.
The usage of Javascript is in multiple domains and is only expanding more. I’ve listed a few domains where Javascript plays a role.
1. Front-end development
Making websites interactive on the front end was the primary purpose for developing Javascript. Any dynamic user interaction on web applications is handled using Javascript.
Front-end frameworks make it easier developing of highly scalable and interactive web applications.
React.js
VueJS
Angular
2. Back-end development
Javascript became more popular after the development of Node.js in 2009. Node.js made it possible to use Javascript code on the server side to build highly scalable back-end services.
Big names like NASA and eBay built large applications using Node.js. There are other back-end languages like Deno under development based on Javascript.
3. Mobile app development
Javascript is used to build mobile applications using React Native framework. React Native was built by Meta Platform (Formerly Facebook).
React Native is used to build Android, Android TV, iOS, macOS, tvOS, Web and Windows applications.
Hence if you’re a web developer who wants to start working on mobile applications, you need not spend time learning new languages. Your Javascript knowledge will help you get started with it immediately.
Javascript usage in other domains
Desktop applications → Electron JS
Artificial Intelligence / Machine Learning → TensorFlow JS
Internet of Things → IoT.js
Game development → PixiJS
Active Community
Amongst the programming languages, JavaScript has one of the largest communities, according to Stackoverflow. In addition to that community, Node.JS has over a billion downloads across the world and is one the most widely used technologies.
With the rise in Full-Stack web development, cross-browser support, and abundance of frameworks/libraries, internet has fully invested in the growth of Javascript, and it is here to stay.
These are few reasons why I always recommend beginners to start their journey with Javascript. Start learning Javascript with this tutorial by Mosh.
Until next time!