You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
What is JavaScript?
What is JavaScript?
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.
A Brief History
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:
- 1995 — JavaScript created at Netscape
- 1997 — ECMAScript 1 standardised
- 2009 — Node.js brings JavaScript to the server
- 2015 — ES6 (ES2015) introduces classes, arrow functions, modules, and more
- Today — Annual releases continue adding features
What Can JavaScript Do?
// 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:
- Interactive web pages — animations, form validation, dynamic content
- Single-page applications — React, Vue, Angular apps
- Server-side APIs — Node.js with Express or Fastify
- Mobile apps — React Native, Ionic
- Desktop apps — Electron (VS Code is built with it)
- Browser extensions and developer tooling
JavaScript vs Other Languages
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 |
Running JavaScript
You can run JavaScript right now in your browser:
- Open any web page
- Press F12 (or right-click and choose Inspect)
- Click the Console tab
- Type code and press Enter
// 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!