JavaScript Tutorial

Learn JavaScript from scratch - The world's most popular programming language

🚀 Welcome to JavaScript!

JavaScript is the programming language of the web. It makes websites interactive and dynamic. Start your coding journey today!


// Your first JavaScript code
console.log("Hello, JavaScript World!");
                                    

Console Output:

Hello, JavaScript World!

What You'll Learn

📝

Basics

Variables, data types, and syntax

let name = "John";
console.log(name);
🔧

Functions

Create reusable blocks of code

function greet() {
  return "Hello!";
}
🎯

DOM Manipulation

Make web pages interactive

document.getElementById("demo")
  .innerHTML = "Changed!";

Events

Respond to user interactions

button.onclick = function() {
  alert("Clicked!");
};

🔹 Why Learn JavaScript?

  • 🌐 Universal: Runs in every web browser
  • 🚀 Fast to Learn: Beginner-friendly syntax
  • 💼 In-Demand: Most popular programming language
  • 🔄 Versatile: Frontend, backend, mobile apps
  • 🆓 Free: No software to buy

🔹 JavaScript Examples

See what JavaScript can do:

🔸 Change Text Content

// Change text when button is clicked
function changeText() {
    document.getElementById("demo").innerHTML = "Text Changed!";
}

🔸 Simple Calculator

// Add two numbers
let a = 5;
let b = 3;
let result = a + b;
console.log("5 + 3 = " + result);

Console Output:

5 + 3 = 8

🔸 Current Date and Time

// Display current date
let now = new Date();
console.log("Today is: " + now.toDateString());

🔹 Ready to Start?

Follow our step-by-step tutorial:

  1. JS Introduction - What is JavaScript?
  2. JS Where To - Where to write JavaScript code
  3. JS Output - How to display results
  4. JS Syntax - Basic rules and structure
  5. JS Variables - Store and use data

🧠 Quick Quiz

What is JavaScript primarily used for?