Lesson 2: What is JavaScript

JavaScript is a programming language we use to add intelligence and behaviour to our websites.

Website - Human Analogy

Let’s compare a website to a human:

  • HTML → Skeleton (structure)
  • CSS → Skin and clothes (looks)
  • JavaScript → Brain and nerves (thinking + actions)

Without JavaScript, the body is there… but it can’t move or respond.

JavaScript is what makes it alive.

What JavaScript Actually Does

JavaScript helps websites:

  • React when you click or type
  • Update information instantly (like live scores)
  • Change what you see without reloading the page

That’s why apps like YouTube, Instagram, or Amazon feel smooth.

“Technical Definition”

JavaScript is a high-level, object-oriented, multi-paradigm programming language.

Breaking it down.


1. Programming Language

A programming language is just a way to give instructions.

Example:

alert("Hello Varun!");

This tells the browser:
“Show a popup with this message.”

That’s it — instruction → action.


2. High-Level Language

There are two types of languages:

Low-level (hard for humans)

Example:

MOV AX, 5
ADD AX, 3

This talks almost directly to the computer’s hardware.


High-level (easy for humans)

JavaScript is like talking in simple English.

You write simple code, and the computer figures out the complicated part.

So you focus on what you want, not how the machine works inside.


3. Object-Oriented

This just means we organize code like real-life things.

Example:

A Car has:

  • Properties → color, brand, speed
  • Actions → start, stop, move

In JavaScript, we can create something similar.

This makes code:

  • Easier to understand
  • Easier to manage

4. Multi-Paradigm

This means JavaScript lets you solve problems in different ways.

Think of cooking:

You can:

  • Fry
  • Bake
  • Grill

Different methods, same goal: make food.


In JavaScript, you can:

  • Write step-by-step instructions
  • Use objects
  • Use functions

You choose what works best.

Leave a Reply

Your email address will not be published. Required fields are marked *