Facebook Pixel

Introduction

Hey everyone! 👋 I’m Harry, a computer programmer and YouTuber from the CodeWithHarry YouTube channel.

Today, I’m creating this JavaScript tutorial to help you learn JavaScript from scratch. You can also use this guide later as a quick reference whenever you want to look up different concepts or code examples.

Let’s start by understanding why we even need JavaScript in the first place.

Why Do We Need JavaScript?

Imagine a website as a house.

  • HTML is like the bricks and walls — it gives the house structure.
  • CSS is like the paint and decorations — it makes the house look beautiful.
  • But without JavaScript, the house won’t have any lights, switches, or running water.

Nothing would move or react.

JavaScript is what makes a website interactive. It’s like adding electricity to the house — now you can click buttons to open doors, turn on lights, or even play music. Without JavaScript, a website would be like a lifeless model — nice to look at, but not functional.

Here’s a quick demo — this modal window below is created using JavaScript:

JavaScript is used for frontend programming but it is also used for backend programming using Node.js. Let's take a step back and understand all these concepts one by one. JavaScript is mainly used for frontend programming, but it can also be used on the backend using Node.js. Before we dive deeper, let’s take a small step back and understand what programming actually means.

What is Programming?

It is a way to talk to computers. A language like Hindi, English, or Bengali can be used to talk to a human but for computers, we need straightforward instructions. Programming is simply a way to talk to computers.

We use languages like English or Hindi to communicate with humans, but computers only understand precise, logical instructions.

Programming is the process of designing, writing, testing, and maintaining code that tells a computer exactly what to do. In other words, it’s how we give life to our ideas using code.

What is ECMAScript?

ECMAScript is a standard on which JavaScript is based! ECMAScript is the standard on which JavaScript is based.

It was created so that everyone talking about JavaScript would refer to the same set of rules and features. You can think of ECMAScript as the official blueprint — and JavaScript as the working version that browsers actually run.

ECMAScript Versions

Beginning in 1997, JavaScript has evolved into many versions. JavaScript has evolved a lot since its creation.

  • ECMAScript 1 (ES1) – released in 1997, the very first version.
  • ECMAScript 2015 (ES6) – a major update that completely changed how JavaScript is written and used.
  • Over the years, many new versions have been released with small but useful improvements.
  • The latest one is ECMAScript 2024 (ES15), which adds new features and syntax improvements.

Each new version makes JavaScript faster, easier, and more powerful.

What is JavaScript?

Let’s finally define what JavaScript actually is:

  • JavaScript is a lightweight, object-oriented programming language.
  • It’s a scripting language mainly used to make web pages interactive.
  • It adds dynamic behavior — like animations, pop-ups, sliders, and form validation.
  • Files end with the “.js” extension.
  • JavaScript is also used in server-side development thanks to Node.js.

Here are some popular frameworks and libraries built with JavaScript:

  • Frontend: React, Angular, Vue
  • Backend: Express, Node.js

Where Does JavaScript Run?

Originally, JavaScript was designed to run inside web browsers — helping webpages react to user actions like clicks, scrolls, and inputs.

But today, with tools like Node.js, it can also run outside the browser, powering web servers, desktop apps, and even IoT devices!

So now you know what JavaScript is, why we use it, and how it evolved. It’s one of the most important languages in web development — and once you learn it, you’ll be able to make websites truly come alive.