Introduction to JavaScript
Day 1
What is JavaScript?
JavaScript (JS) is a high-level programming language mainly used to make websites dynamic and interactive.
Works in all modern web browsers.
Can handle:
● Animations
● Interactive forms
● Dynamic content updates without refreshing the page
Not limited to browsers anymore:
● With Node.js, JS runs on servers.
● Can be used for desktop apps, mobile apps, game development, IoT devices, and more.
Who invented it and when?
Brendan Eich created JavaScript in 1995 while working at Netscape Communications.
Built the first version in just 10 days.
Initially called Mocha, then LiveScript, and finally JavaScript.
Fun fact: The name “JavaScript” was partly a marketing move to ride the popularity of Java at the time
(even though they’re very different languages).
How it became popular & evolved
In the mid-90s, it was a simple scripting language to enhance webpages.
Grew rapidly with browser wars (Netscape vs Internet Explorer).
Became one of the three core web technologies:
1. HTML → Structure
2. CSS → Styling
3. JavaScript → Interactivity
Today, JavaScript powers:
● Frontend frameworks: React, Angular, Vue
● Backend: Node.js, Deno
● Cross-platform apps: Electron, React Native
Programming nature of JS
Single-threaded:
● Executes one instruction at a time in sequence.
● Uses an event loop to manage asynchronous tasks without freezing the page.
Interpreted language:
● Code is read and executed line-by-line by the JavaScript engine (e.g., Google’s V8 in Chrome).
● No separate compilation step needed.
Our first JS command: console.log()
console.log("Hello World");
Purpose: Displays output in the browser’s console (mainly used for debugging and testing).
What’s next?
Tomorrow: Data Types in JavaScript
● Numbers, Strings, Booleans, Null, Undefined, Objects, Symbols, BigInt
We’ll learn each type with examples.