JavaScript is the language every web browser speaks and, with Node.js, the language of millions of servers. This lesson covers the language's mental model, the developer console, the difference between JavaScript and Java, and your first working script. By the end you will know what makes JavaScript different from languages like Python or Java and why it powers everything from animated menus to spacecraft dashboards.
What JavaScript is
JavaScript is a high-level, just-in-time-compiled, multi-paradigm language. Every modern browser ships a JavaScript engine that parses your source, compiles it to machine code, and runs it. The original purpose was to add interactivity to web pages. The current scope is far wider: server backends with Node.js, mobile apps with React Native, desktop apps with Electron, and even machine learning in the browser with TensorFlow.js.
// A complete browser program in three lines
const greeting = "Hello, World!";
const name = "Tutorsbot";
console.log(`${greeting} I am ${name} learning JavaScript in 2026.`);
The browser developer console
Every modern browser includes a developer tools panel. Open it with F12 or Ctrl-Shift-I. The Console tab is a REPL: type any JavaScript expression and press Enter to see the result. Use it to inspect live pages, try out APIs, and debug interactively.
> 1 + 2
3
> "tutors".toUpperCase()
'TUTORS'
> Math.sqrt(144)
12
JavaScript versus Java
The name is a marketing artifact from 1995. JavaScript and Java are unrelated languages. JavaScript is dynamically typed, prototype-based, and runs in any browser. Java is statically typed, class-based, and runs on a virtual machine. Confusing the two is a rite of passage; just remember JavaScript is the one in the browser.
| Feature | JavaScript | Java |
|---|---|---|
| Typing | Dynamic, with optional static hints | Static, mandatory |
| Runtime | Browser, Node.js, Deno, Bun | JVM |
| Object model | Prototype-based | Class-based |
| Concurrency | Single-threaded with async/await | Multi-threaded |
| File extension | .js, .mjs, .cjs | .java |
The ECMAScript versions that matter in 2026
JavaScript is standardized as ECMAScript (ES). ES2015 (ES6) introduced the modern syntax most code uses today: let, const, arrow functions, classes, template literals, and modules. ES2020 added the optional chaining and nullish coalescing operators you will see in modern code. ES2024 brought array grouping, well-formed Unicode, and a settled Promise.withResolvers.
// Modern ES2024 syntax you will use every day
const user = { name: "Asha", profile: { age: 28 } };
console.log(user?.profile?.age ?? "unknown"); // 28
console.log(user?.settings?.theme ?? "dark"); // dark
The JavaScript ecosystem in 2026
The JavaScript ecosystem is the largest in software development. The npm registry hosts more than three million packages. Vite has largely replaced Webpack as the default bundler. TypeScript is widely adopted and is the language of choice for new projects. On the server side, Node.js, Deno, and Cloudflare Workers each serve different deployment needs. On the client side, React, Vue, and Svelte are the major UI frameworks. For testing, Vitest has largely replaced Jest. The ecosystem changes quickly, but the core language you learn in this tutorial stays stable; that is the point.
Summary
JavaScript is the language of the browser and the Node.js server. The console is your REPL. ES2015 onward is the modern syntax. The next lesson covers how to install a real JavaScript runtime (Node.js), run scripts, and use the package manager that ships with it.
Where JavaScript runs
The same JavaScript syntax runs in three very different environments. In the browser, the script is loaded with a script tag or as a module and executes in the page's main thread plus the Web Worker pool for background work. In Node.js, the script runs as a server process with access to the file system, network, and child processes. In embedded environments like Deno and Bun, the runtime is similar to Node but with TypeScript and Web-standard APIs as defaults. The language is the same; the global objects and the available APIs are different. window in the browser, process in Node, Deno.env in Deno.
// Detect the runtime
const runtime = typeof window === "object"
? "browser"
: typeof process === "object" && process.versions?.node
? "node " + process.versions.node
: typeof Deno === "object"
? "deno " + Deno.version
: "unknown";
console.log(runtime);
Your first script with Node
Install Node.js from nodejs.org or via a version manager like nvm or fnm. Create a file named hello.js with the script you want to run, then execute it with node hello.js. Node reads the file, compiles it, and runs it. The output goes to stdout; the errors go to stderr. Once you can run a script, you can run any library that uses Node.
// hello.js
console.log("Hello from Node.js", process.version);
// Run: node hello.js
// Output: Hello from Node.js v20.11.0
Learning path for 2026
The fastest path to useful JavaScript is to learn in this order. First, the basics: variables, control flow, loops, functions. Second, the data structures: arrays, objects, Maps and Sets. Third, the object model: classes, prototypes, and inheritance. Fourth, asynchronous code: promises, async/await, and the event loop. Fifth, modules and tooling: import/export, npm, and a bundler like Vite. Finally, a testing framework like Vitest and a framework like React or Vue for the browser, or Express or Fastify for the server. The lessons in this tutorial cover steps one through five. The ecosystem is large but the core language is small; mastering the core unlocks everything else.