Learn JavaScript 🚀
Learn JavaScript from beginner to advanced with simple explanations, real examples, coding exercises and a live JavaScript editor.
📊 Your Learning Progress
25% completed
📘 JavaScript Basics
JavaScript is a programming language used to make websites interactive and dynamic.
console.log("Hello, JavaScript!");
🔤 Variables & Data Types
Variables are used to store information in JavaScript. Use let for changeable values and const for values that should not be reassigned.
let name = "John";
const age = 25;
let isStudent = true;
console.log(name);
console.log(age);
console.log(isStudent);
🔀 If / Else & Loops
Conditions allow your program to make decisions. Loops repeat code multiple times.
let marks = 75;
if (marks >= 50) {
console.log("Pass");
} else {
console.log("Fail");
}
for (let i = 1; i <= 5; i++) {
console.log(i);
}
⚙️ Functions
A function is a reusable block of code.
function greet(name) {
return "Hello " + name;
}
console.log(greet("John"));
📦 Arrays & Objects
Arrays store multiple values. Objects store data using key-value pairs.
const fruits = [
"Apple",
"Mango",
"Banana"
];
console.log(fruits[0]);
const user = {
name: "John",
age: 25
};
console.log(user.name);
🌐 DOM Manipulation
The DOM allows JavaScript to interact with HTML elements and change webpage content.
document.querySelector("#title")
.textContent = "JavaScript is Awesome!";
⚡ Events
Events happen when users interact with a webpage, such as clicking a button or typing into an input.
document.querySelector("#myButton")
.addEventListener("click", function() {
alert("Button clicked!");
});
🧪 Live JavaScript Editor
Write JavaScript code below and click Run Code to see the output.
📝 JavaScript Exercises
🎯 Course Levels
🌱 Beginner
Basics, Variables, Operators and Conditions.
🚀 Intermediate
Functions, Arrays, Objects and DOM.
🔥 Practice
Events, Projects, Exercises and Live Coding.