JavaScript ยท Chapter 1 of 55

JavaScript Introduction

JavaScript is the programming language of the web. Created in 1995 by Brendan Eich, it lets you add interactivity, logic and dynamic behaviour to otherwise static HTML pages.

Today JavaScript runs everywhere: in browsers, on servers (Node.js), on mobile apps, and even on IoT devices. Together with HTML and CSS, it forms one of the three core technologies of the web.

Why JavaScript?

JavaScript is the only language that runs natively in every web browser. It is beginner-friendly, flexible, and has a massive ecosystem of libraries and frameworks like React and Vue.

What can it do?

JavaScript can change HTML content and styles, react to user events like clicks, validate forms, fetch data from servers, and build entire applications.

Example 1 (javascript)
console.log("Hello, World!");
Output
Hello, World!

console.log() prints output, usually visible in the browser's developer console.

Example 2 (javascript)
let name = "Ada";
console.log("Hi " + name);
Output
Hi Ada

Variables hold values that can be combined with strings.

Key points

  • JavaScript adds interactivity and logic to web pages.
  • It runs in browsers and, via Node.js, on servers too.
  • It is one of the three core web technologies (HTML, CSS, JS).
  • JavaScript is dynamically typed and interpreted.
๐Ÿ’ก Note: JavaScript has nothing to do with Java โ€” the similar name was a marketing decision in the 1990s.

๐Ÿ“ Quick Quiz

1. Who created JavaScript?

2. JavaScript runs:

3. Which technology is NOT one of the three core web technologies?