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.