You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
JavaScript is the programming language of the web. Originally created in 1995 by Brendan Eich at Netscape, it was designed to add interactivity to web pages. Today it runs everywhere — in browsers, on servers (via Node.js), in mobile apps, and even on embedded devices.
JavaScript was created in just ten days in 1995. Despite its rushed origins, it quickly became the dominant language for client-side web development. The language was standardised as ECMAScript, and modern versions (ES6 and beyond) have transformed it into a powerful, expressive language suited for large applications.
Key milestones:
// In the browser: update the page without reloading
document.getElementById("greeting").textContent = "Hello, World!";
// On the server with Node.js: read a file
const fs = require("fs");
const data = fs.readFileSync("notes.txt", "utf8");
console.log(data);
JavaScript powers:
JavaScript is dynamically typed — you do not declare variable types. It is interpreted (or JIT-compiled in modern engines). It uses a prototype-based object system rather than classical inheritance.
| Feature | JavaScript | Python | Java |
|---|---|---|---|
| Typing | Dynamic | Dynamic | Static |
| Runs in browser | Yes | No | No |
| Server side | Yes (Node.js) | Yes | Yes |
| Syntax style | C-like | Indented | C-like |
You can run JavaScript right now in your browser:
// Try this in your browser console
console.log("Hello from JavaScript!");
2 + 2
Math.random()
For larger programs, save a file with a .js extension and run it with Node.js:
// hello.js
console.log("Hello, World!");
Then in the terminal:
node hello.js
JavaScript's ubiquity makes it one of the most practical languages to learn. Whether you want to build websites, mobile apps, or backend services, JavaScript opens all those doors. Let's start learning it!