JavaScript is the programming language of the web. Every modern browser runs it, which makes it the only language that works natively on every website: it makes pages interactive, updates content without reloading, validates forms and powers complete web applications. With runtimes such as Node.js, JavaScript also runs on servers, so one language can cover both the front end and the back end.
A Short History
JavaScript was created by Brendan Eich at Netscape in 1995. Despite the name, it has nothing to do with Java; the name was a marketing choice at the time. The language is standardised as ECMAScript by Ecma International, with a new edition every year since 2015. That 2015 edition (ES6) added classes, modules, arrow functions and promises, and turned JavaScript into a language suited for large applications.
How JavaScript Works
- In the browser: the browser's engine downloads the code, compiles it on the fly and runs it. JavaScript reads and changes the page through the DOM and talks to servers through APIs, often exchanging JSON.
- Event loop: JavaScript runs on a single thread and handles slow tasks such as network requests asynchronously, with promises and async/await, so the interface stays responsive.
- On the server: Node.js, and newer runtimes such as Deno and Bun, run JavaScript outside the browser for APIs, real-time services and tooling.
The Ecosystem
JavaScript has one of the largest ecosystems of any language, with millions of packages on npm. Frameworks such as React and Next.js structure web applications; React Native brings the same model to mobile apps; libraries such as ethers.js and viem connect web apps to blockchains. WebAssembly complements JavaScript for compute-heavy work in the browser.
JavaScript and TypeScript
TypeScript is JavaScript with a type system. It compiles to plain JavaScript, but catches whole classes of errors before the code runs. For business software that has to be maintained for years, we usually write TypeScript rather than plain JavaScript. See TypeScript development, Next.js development and web applications.
Frequently Asked Questions
Is JavaScript the same as Java?
No. They are different languages with different designs and uses. The similar name is a historical marketing decision.
Should I use JavaScript or TypeScript?
For small scripts JavaScript is fine. For applications that grow and are maintained by a team, TypeScript reduces bugs and makes changes safer.
Can JavaScript be used for the back end?
Yes. Node.js runs JavaScript on servers and is widely used for APIs and real-time services such as chat and live dashboards.