Why do I love JavaScript?

JavaScript has been the language I go for whenever I need to write a quick app or prototype a small idea. Then, over the years, it became one of my favorite languages. In this post, I'm going to list a couple of reasons for my sympathy for JavaScript.

1. There's a simple and convenient way of creating an app on almost every platform. There are countless front-end and back-end frameworks for web development (where Express.js and React are my favorites).

const express = require('express')
const app = express()
app.get('/', (req, res) => res.send('Hello world!'))
app.listen(3000, () => console.log('Listening.'))

Starting a Hello World server in Express.js takes only 4 lines of code!

There's Electron for desktop apps and React Native for the mobile platform. They might not be the most performant or the ideal way for long-term development, but I believe all of them are beginner-friendly frameworks and have quite rich documentations.

2. It's easy to extend the language. I love how it's possible to create tools and frameworks like Babel, Typescript, or React. These tools (sometimes majorly) change the syntax of the code we write and they let us get the relevant vanilla EcmaScript version as the output. Take React, for example. We write a whole new JavaScript subset called JSX and we get a seamlessly-running browser-compatible JavaScript output, where all the conversion is handled within JavaScript modules as well. I find this simply awesome! (Extra: Take a look at the lovely Dogescript!)

3. It has a large community. Possibly the largest. It's a very good opportunity to find answers to almost every question and error that we encounter. Moreover, I like exploring the modules, awesome projects, or tips and articles that are coming up online every day.

4. It contains awesome language features, adding up every year. I like how a new syntactic sugar is added with every release of the new ECMAScript version.

const nameLength = db?.user?.name?.length;

With the optional chaining feature came with ES2020, we can safely access inner properties where any of them can be undefined or null.

I believe these features increase both the writability and readability of the language.

There are many other advantages and also downsides (just as much) of JavaScript, so this was a compilation of my personal favorite aspects.