Why JavaScript? The Language of the Web
JavaScript কেন শিখবেন — ওয়েবের একমাত্র ভাষা
1. Before We Begin — What Is JavaScript?
JavaScript is the programming language that runs in every web browser on Earth. When you click a button on Facebook, when bKash shows a balance, when Google's homepage suggests a search — that interactivity is JavaScript. It is the only programming language a browser understands natively, which is why it has become the most widely deployed language ever made.
JavaScript started as a "scripting" language for buttons and form validation in 1995, but in 2026 it powers full applications — entire websites, mobile apps, desktop apps (Slack, VS Code, Discord), and even servers (Node.js).
2. A Short History of JavaScript
In May 1995, Netscape — the company that built the first popular web browser — needed a way to make web pages interactive. They hired Brendan Eich, who designed the language in just 10 days. It was originally called Mocha, then LiveScript, and finally JavaScript — a marketing name riding on Java's popularity at the time.
Today JS is standardized as ECMAScript. New features land every year:
ES6 (2015) brought let/const, classes, modules, arrow functions; ES2020 brought
optional chaining; ES2024 brought top-level await and grouping. The language we'll learn is
modern ES2024.
3. JS Engines — How Your Code Actually Runs
JavaScript itself is just a specification (a document). To actually run JS, you need a JS engine — a real program written in C++ that reads your JavaScript and executes it. The four major engines:
- V8 — Google. Powers Chrome, Edge, Node.js, Deno, Bun.
- SpiderMonkey — Mozilla. Powers Firefox.
- JavaScriptCore — Apple. Powers Safari and iOS.
- Chakra — Microsoft (legacy). Powered old Edge before it switched to V8.
Modern engines do just-in-time (JIT) compilation: they parse your JS, profile which functions are "hot," and compile those into machine code on the fly. This is why modern JS is shockingly fast — often within 2× of C in many benchmarks.
4. Your First JavaScript — Run It Live 🚀
Below is a tiny JS program. Click Run ▶ — your browser will execute it instantly, because every browser already has a full JS engine built in. No installation needed.
// Your first JavaScript program
const name = "Bangladesh";
console.log(`Hello, ${name}!`);
console.log("হ্যালো বাংলাদেশ!");
const year = new Date().getFullYear();
console.log(`The year is ${year}.`);
| Piece | Meaning | বাংলায় |
|---|---|---|
const name = "..." | Declares a constant variable holding the string. | একটি constant variable ঘোষণা করে যা string ধারণ করে। |
console.log(...) | Prints to the browser's developer console. | ব্রাউজারের developer console-এ লেখা প্রিন্ট করে। |
`...${x}...` | Template literal — embeds a value inside a string. | String-এর ভেতরে variable বসানোর সবচেয়ে সহজ উপায়। |
new Date().getFullYear() | Creates a Date object and asks for the year. | একটি Date object তৈরি করে এবং সেটি থেকে year বের করে। |
; | Optional statement terminator (recommended). | statement শেষ করার চিহ্ন (ঐচ্ছিক হলেও ব্যবহার করা ভালো)। |
5. Where JavaScript Lives Today (JavaScript আজ কোথায়)
Chrome, Firefox, Safari, Edge — সব ব্রাউজারে।
Netflix, Uber, LinkedIn, PayPal — সবাই Node ব্যবহার করে।
React Native, Ionic, Capacitor — JS দিয়ে native app।
VS Code, Slack, Discord, Figma — সব Electron-এ।
Espruino, Johnny-Five, Tessel — sensor ও robot-এ।
LangChain.js, TensorFlow.js — AI app-এর frontend।
6. The Trade-offs — JS Is Not a Free Lunch
✅ What JS Gives You (যা পাবেন)
- Runs everywhere — no install needed
- Massive ecosystem (npm has 2M+ packages)
- One language for frontend + backend
- Async-friendly by design
- Huge job market
⚠️ What JS Asks of You (সতর্কতা)
- Loose typing — easy to make silly bugs
- Many ways to do the same thing
- Browser quirks & legacy baggage
- Can be slow if used carelessly
- The ecosystem changes fast
JavaScript-এর এমন এক বিশেষত্ব আছে — এটি প্রতিটি user-এর device-এ স্বয়ংক্রিয়ভাবে চলে। কোনো permission, install বা Wi-Fi লাগে না। এই কারণেই এটি এত শক্তিশালী।
7. Glossary (শব্দকোষ)
| Term | Meaning | বাংলায় |
|---|---|---|
| ECMAScript | The official spec that JS implements. | JavaScript-এর সরকারি specification বা মান। |
| Engine | The C++ program that runs JS (e.g., V8). | JavaScript চালানোর জন্য C++-এ লেখা প্রোগ্রাম, যেমন V8। |
| Runtime | Engine + extra APIs (browser DOM, Node fs, etc.) | Engine + অতিরিক্ত API (browser-এ DOM, Node-এ fs ইত্যাদি)। |
| Console | The DevTools panel where console.log shows up. | Browser-এর DevTools-এ console.log যেখানে দেখা যায়। |
| JIT | Just-in-time compilation — compiling hot code on the fly. | সক্রিয় কোডকে দ্রুত machine code-এ রূপান্তর করার কৌশল। |
8. Practice Problems
Every problem has a Show Answer button. The answer contains real JS code that you can run right here in the browser. Try the problem yourself first, then check.
-
Write a program that prints your name and your favorite browser using
console.log.আপনার নাম এবং প্রিয় ব্রাউজারের নামconsole.logদিয়ে প্রিন্ট করুন।✨ Show Answer (উত্তর দেখুন)
ans1.jsconst name = "Arif Hossain"; const browser = "Firefox"; console.log(`Name: ${name}`); console.log(`Browser: ${browser}`); -
Print three lines describing the year, month, and day using a single
Dateobject.একটিDateobject থেকে year, month এবং day আলাদা তিন লাইনে প্রিন্ট করুন।✨ Show Answer (উত্তর দেখুন)
ans2.jsconst now = new Date(); console.log(`Year: ${now.getFullYear()}`); console.log(`Month: ${now.getMonth() + 1}`); console.log(`Day: ${now.getDate()}`);মনে রাখবেন:
getMonth()0 থেকে শুরু হয়, তাই +1 করতে হয়। -
Explain in 3 sentences why JavaScript runs in every browser but Python does not.তিন বাক্যে ব্যাখ্যা করুন — JavaScript প্রতিটি ব্রাউজারে চললেও Python কেন চলে না।
✨ Show Answer (উত্তর দেখুন)
Answer: (1) JavaScript was designed in 1995 specifically to run inside web browsers, so every browser ships with a built-in JS engine. (2) Python was designed earlier as a general-purpose language for desktops, with no native browser integration. (3) For Python to run in a browser today, you need extra tools like Pyodide (a WebAssembly port) — JavaScript needs nothing at all.
(১) JavaScript ১৯৯৫ সালে browser-এ চালানোর জন্যই তৈরি, তাই প্রতিটি browser-এর সাথে JS engine আগে থেকেই থাকে। (২) Python আগে থেকে desktop-এর জন্য তৈরি, browser-এর সাথে এর কোনো native integration নেই। (৩) Browser-এ Python চালাতে এখনো Pyodide-এর মতো অতিরিক্ত tool লাগে — JavaScript-এর সেটা লাগে না।
-
Write a program that prints the total number of seconds in one week.এক সপ্তাহে মোট কত সেকেন্ড — সেটি প্রিন্ট করার একটি প্রোগ্রাম লিখুন।
✨ Show Answer (উত্তর দেখুন)
ans4.jsconst secondsPerWeek = 7 * 24 * 60 * 60; console.log(`One week has ${secondsPerWeek} seconds.`);Output:
One week has 604800 seconds. -
In one paragraph, explain who Brendan Eich is and why his work matters.একটি অনুচ্ছেদে ব্যাখ্যা করুন — Brendan Eich কে এবং তাঁর অবদান কেন গুরুত্বপূর্ণ।
✨ Show Answer (উত্তর দেখুন)
Answer: Brendan Eich is an American computer scientist who designed JavaScript in 10 days in May 1995 while working at Netscape. JavaScript went on to become the dominant language of the web, with billions of devices running it every second. Without Eich's quick, pragmatic design, the modern interactive web — and ultimately Node.js, React, and most of frontend tooling — would not exist.
Brendan Eich একজন আমেরিকান কম্পিউটার বিজ্ঞানী, যিনি ১৯৯৫ সালের মে মাসে Netscape-এ কাজ করার সময় মাত্র ১০ দিনে JavaScript তৈরি করেন। পরবর্তীতে এটি ওয়েবের প্রধান ভাষা হয়ে ওঠে এবং বর্তমানে কোটি কোটি device-এ প্রতি মুহূর্তে চলছে। তাঁর তৈরি এই ভাষা ছাড়া আজকের interactive web, Node.js, React এবং frontend tooling-এর অস্তিত্বই থাকতো না।
Summary — Module 01
JavaScript is an interpreted, JIT-compiled, multi-paradigm language designed in 10 days in 1995 by Brendan Eich. It is standardized as ECMAScript and runs in every browser, on servers via Node.js, on desktops via Electron, and on mobile via React Native. It is the only language with native browser support — and that single fact has made it the most reachable programming language ever made.