Featured
- Get link
- X
- Other Apps
⚡ Day 1 — Introduction to JavaScript
⚡ Day 1 — Introduction to JavaScript
Welcome to Day 1 of your 45-Day JavaScript Journey! 🎉 JavaScript is the language that brings **life and interactivity** to the web. If HTML is the skeleton and CSS is the skin, then JavaScript is the **brain** that makes your webpage think and react. By the end of this course, you’ll be able to build full web applications, games, and interactive websites — all with pure JavaScript.
🌍 1️⃣ What is JavaScript?
JavaScript (JS) is a **programming language** used to make websites interactive. It runs directly in the **browser**, meaning users don’t need to install anything. It can also be used on the **server side** (using Node.js), making it one of the most versatile languages in the world.
🧠 2️⃣ Why Learn JavaScript?
- ✅ It’s the core of front-end web development.
- ✅ It powers frameworks like React, Angular, and Vue.
- ✅ It’s also used for backend (Node.js) and mobile apps (React Native).
- ✅ It’s beginner-friendly and highly in demand by companies.
⚙️ 3️⃣ How JavaScript Works
JavaScript runs in your web browser using a **JavaScript Engine** (like Chrome’s V8 engine). When you open a webpage, the browser reads HTML first, then loads and executes the JavaScript code line by line.
💻 4️⃣ Adding JavaScript to a Web Page
There are 3 main ways to add JavaScript:
- Inline: Write inside an HTML tag using
onclick - Internal: Inside a
<script>tag in the HTML file - External: Link a separate JS file
<!DOCTYPE html>
<html>
<head>
<title>JS Example</title>
</head>
<body>
<h1>Welcome to JavaScript</h1>
<button onclick="alert('Hello Rahul!')">Click Me</button>
<script>
console.log('Hello from Internal Script!');
</script>
</body>
</html>
You can see results using Console in your browser (Right Click → Inspect → Console Tab).
🧩 5️⃣ console.log()
The console.log() function prints messages to the browser console. It’s mainly used for debugging.
console.log("Welcome to JavaScript");
console.log(10 + 5);
console.log("Radha" + " " + "Krishna");
🧮 6️⃣ JavaScript Features
- Dynamic — no need for strict data types.
- Interpreted — runs line-by-line.
- Event-driven — responds to user interactions.
- Object-oriented — supports reusable components.
🧠 7️⃣ Practice Task
- Create a webpage that displays a welcome message using
alert(). - Write 3
console.log()statements for your name, age, and hobby. - Use comments (
//) to describe your code.
🎯 Summary
Today, you learned what JavaScript is, why it’s important, and how to run it. Tomorrow, we’ll dive into the basics — **variables, constants, and data types** — the building blocks of every JS program.
Popular Posts
💙 Day 27: Bootstrap Mini Project – Responsive Portfolio Page
- Get link
- X
- Other Apps
🎨 Day 2: Headings, Paragraphs & Text Formatting
- Get link
- X
- Other Apps
Comments
Post a Comment