No. JavaScript started as a browser scripting language, but today it also runs on servers, in desktop and mobile apps, on command-line tools, in cloud functions and on some embedded devices. The same language, and often the same code, can be used in all of these places.
What changed is the runtime. A browser is only one host for the language; Node.js, Deno, Bun and other engines run it outside the browser, and frameworks wrap it for native and desktop targets.
JavaScript is specified by ECMAScript, a standard that says nothing about web pages. The browser objects you know, such as window and document, are not part of the language. They are APIs that a browser adds. Any program that embeds a JavaScript engine (V8, JavaScriptCore, SpiderMonkey and others) can provide its own APIs, such as files, sockets and processes, and that is how server-side runtimes work.
Today's mainstream runtimes are Node.js, Deno and Bun. All three run the same core language, and most of them support the same web-standard APIs, such as fetch, URL and AbortController.
Node.js lets you build HTTP servers, REST and GraphQL APIs, background workers and command-line tools. This is a complete server using built-in modules only:
Save it as server.mjs and run node server.mjs. The node: prefix marks a built-in module, and ES modules (import) are the modern default over require(). In production you would normally use a framework such as Express, Fastify or Hono on top of this.
JavaScript and TypeScript are also used to ship installable apps.
| Target | Common tools | How it works |
|---|---|---|
| iOS and Android | React Native, Expo | JavaScript logic drives real native UI components |
| Desktop | Electron, Tauri | A web UI runs in a bundled or system web view; Tauri uses a Rust backend, Electron bundles Node.js |
| Installable web apps | Progressive Web Apps | A web app with a manifest and a service worker that can be installed from the browser |
| Command-line tools | Node.js, Deno, Bun | Scripts and packages published to npm or JSR |
Many well-known desktop applications are built on Electron, which is a good sign of how far the language reaches.
Most serverless platforms support JavaScript or TypeScript as a first-class runtime, including AWS Lambda, Google Cloud Functions, Azure Functions, Cloudflare Workers and Vercel. Cold starts are short and the language is a natural fit for event handlers that return JSON.
The handler uses only web-standard objects, so the same shape works on several edge platforms.
JavaScript is a general-purpose tool, not the best tool for every job. Heavy numeric computing, systems programming and tight real-time control are often better served by Python with native libraries, Rust, Go or C++. For large codebases, TypeScript adds static typing to JavaScript and is the usual choice for teams.
It can for many web backends, because Node.js handles large numbers of concurrent network connections well. For CPU-heavy work you may still pick Go, Java, Rust or Python.
No. Install Node.js, Deno or Bun and run node file.js from a terminal. No browser is involved.
TypeScript is a typed superset that compiles to JavaScript. Every valid JavaScript program is valid TypeScript, and the type checks exist only at development time.
Yes. React Native with Expo lets you build iOS and Android apps with JavaScript or TypeScript, though some features need native modules.
JavaScript is not only for websites. Learn the language itself, then choose a runtime for your target: Node.js, Deno or Bun for servers and tools, React Native for mobile, Electron or Tauri for desktop, and edge platforms for functions. The language and its web-standard APIs carry across all of them.