🎯 Class Objectives (Learning Outcomes)
- By the end of this class, students will be able to:
- Understand what JavaScript is and why it’s important.
- Know where and how JavaScript runs (browser + Node.js).
- Connect JavaScript with an HTML file in three ways.
- Write and run their first program using
console.log().
🧩 1️⃣ What is JavaScript?
JavaScript is the brain of a website — it makes webpages interactive and dynamic.
- HTML → gives structure (skeleton)
- CSS → gives style (clothes)
- JavaScript → gives behavior (actions)
🧠 Example of what JS can do:
- Show popups and alerts
- Validate form inputs (like checking if a field is empty)
- Change text or styles dynamically
- Fetch live data from APIs
- Create entire web applications (e.g., YouTube, Facebook, Spotify)
🌐 2️⃣ Where Does JavaScript Run?
JavaScript can run in two main environments:
| Name |
Description |
Examples |
| Browser |
Runs JavaScript code inside web pages (frontend) |
Chrome, Firefox, Edge |
| Node.js |
Runs JavaScript outside the browser (backend) |
Server-side applications |

🧮 Try It Out:
- Open your browser → Right-click → “Inspect” → Console tab