JavaScript (JS)
JavaScript is the programming language of websites: it makes a page interactive, meaning it reacts to what you do, rather than being just readable text and images.
In plain terms
Imagine a website as a house. HTML is the walls and rooms, CSS is the paint and furniture, and JavaScript is the electricity: it opens the door automatically, switches the lights, and rings the bell. Without it, the page is roughly like a printed sheet: readable, links work, but almost nothing reacts to what you do.
When the cart counter in an online store switches instantly, you drag the map with your finger, or the AI response appears gradually in the chat window, JavaScript is working in the background.
It no longer lives only in the browser. It runs on servers, in mobile applications, and in desktop programs, making it one of the most used programming languages in the world. Many AI tools and coding agents are built in this language or its relative, TypeScript.
How it works
- You open a webpage, and your browser downloads the JavaScript code associated with the page along with the text and images.
- The engine built into the browser runs this code on your machine, not on a remote server.
- The code monitors what you do: clicking, typing, scrolling. A pre-written sequence of instructions runs for each such event.
- The instructions rewrite part of the page or request new data from the server in the background, so the entire page does not need to be reloaded.
- Outside the browser, a runtime environment such as Node.js executes the same language, making it usable on servers and in command-line tools.
An everyday example
You buy a train ticket online, and as you type the first three letters of the station, a list of results drops down. The page does not reload: JavaScript sends the letters to the server and renders the station names received in response.
Who is affected
A common misconception
Limits and risks
- The browser runs code in an isolated environment, so it cannot access your computer's files. However, JavaScript on a hacked or malicious site can steal what you provide on that page (for example, passwords, card data) or display a deceptive interface.
- Too much or poorly written JavaScript slows down the site and drains the phone's battery faster.
- Most advertising and tracking codes are JavaScript, making them a primary tool for monitoring browsing habits.
- The language is permissive, often reporting many errors only during execution; therefore, stricter TypeScript is frequently used instead for larger systems.
Similar, but not the same
- Java – A standalone, distinct programming language used mainly in enterprise systems and Android applications.
- TypeScript – A stricter variant of JavaScript extended with types. Its code is typically converted to JavaScript before execution.
- HTML – HTML describes the structure of the page, while JavaScript defines how the page behaves.
Related concepts
programming language, web development, software development
TypeScript, JSON, HTML, CSS, Python, browser, API
A brief history
Brendan Eich created the language in 1995 for the Netscape browser, traditionally in about ten days. It was standardized in 1997 under the name ECMAScript. Experiments were conducted with it on servers in the 1990s, but it truly became widespread with the launch of Node.js in 2009.
Where things stand
Even at the end of 2026 it remains the web's base language, used by almost every website, with its standard updated annually. Coding agents routinely write JavaScript and TypeScript code, and many AI tools are built in it as well.
Also known as
JavaScript · JS · Javascript · javascript · ECMAScript · ES6 · Java Script · JavaScript code
Sources
This entry was machine-edited and has undergone machine expert review; the “In the news” section updates automatically from Agent Age stories.