Introduction

What JavaScript is and where it's used

What is JavaScript?

JavaScript (JS) is the programming language of the web. It's one of the three core technologies of web development, alongside HTML and CSS. JavaScript makes web pages interactive and dynamic.

Where JavaScript Runs

  • 🌐 In the Browser: Every modern web browser has a built-in JavaScript engine (V8 in Chrome/Edge, SpiderMonkey in Firefox, JavaScriptCore in Safari).
  • 🖥️ On the Server: Node.js allows JavaScript to run on the server side, enabling full-stack development.
  • 📱 Mobile & Desktop: Frameworks like React Native and Electron allow you to build native mobile and desktop apps with JavaScript.

What Can JavaScript Do?

✓ Manipulate HTML & CSS

Change content, styles, and structure dynamically

✓ Handle User Events

Respond to clicks, keyboard input, form submissions

✓ Make Network Requests

Fetch data from APIs without page reloads

✓ Store Data Locally

Use localStorage, sessionStorage, and cookies

Your First JavaScript

Let's write your first line of JavaScript that displays a message:

console.log("Hello, JavaScript!");

Open your browser's developer console (F12 or Cmd+Option+J on Mac), paste this code, and press Enter. You'll see the message appear!

💡 Why Learn JavaScript?

  • Most Popular: JavaScript is the most widely used programming language
  • Versatile: Build websites, mobile apps, servers, desktop applications, games, and more
  • In-Demand: JavaScript developers are highly sought after
  • Beginner-Friendly: Easy to start, runs in every browser without setup
  • Huge Ecosystem: Millions of packages (npm) and active community