What it is
JavaScript, abbreviated JS, is the programming language browsers run. A page can use it to react to clicks, change the DOM (the document tree), and call HTTP APIs. The language is also used on servers and in tools via Node.js, but the browser is why it exists. The standard is ECMAScript. People say ES6 or ES2015 for the version that added let, const, arrow functions, promises and classes; everything modern assumes at least that.
JavaScript is not Java. The names are historical marketing, not a family relationship. It is not TypeScript either. TypeScript is a typed layer that compiles or strips down to JavaScript. If you are building an AI feature in the browser, JavaScript for AI Applications covers the application concerns; this page is the language those apps are written in.
Why and when it is used
Use JavaScript when the code must run in a browser: interfaces, design tools, offline-capable pages. Use it on the server with Node when the team wants one language on both sides, or when the workload is I/O (APIs, streams, websockets). Use TypeScript instead of plain JS for anything you must maintain, which is most application code. Plain JS is still right for a tiny script, a bookmarklet, or learning the actual runtime behaviour without a compiler in the way.
Do not use JavaScript to do heavy numeric work in the browser if a server or a specialised library should own it. Do not sprinkle jQuery-era patterns into a new React codebase out of nostalgia.
How it works
JavaScript is single-threaded in the usual browser and Node model. An event loop runs your code, then runs callbacks and promise reactions when I/O completes. That is why a long for loop freezes a page: nothing else can paint until it finishes. Promises and async/await are how you wait for a network call without blocking the loop incorrectly. await still occupies the function; it does not make the CPU parallel.
Values have types; variables do not, until you add TypeScript. Objects are bags of properties. Arrays are objects. Equality is a trap: == coerces types, === does not. this depends on how a function is called. Modules (import/export) are the modern structure; older scripts used globals. In the browser, modules need a server or a bundler context, not always file://. npm installs libraries into node_modules.
Technologies and dependencies
A browser, or Node, and a package manager. For UI, HTML and CSS are the other two legs. React is a library on top of JS, not a separate language. A bundler (Vite is a common default now) turns modules into files the browser can cache. ESLint catches footguns. The DOM and fetch are web platform APIs, not part of the language core, which is why the same JS on Node needs a fetch polyfill only on older versions and has no document.
How to get started
- In a browser devtools console, type small expressions: strings, arrays,
map, a function. You are learning the language, not a framework. - Make a folder with
index.htmlthat loadsmain.jsas a module. Handle one button click and update one element. - Add
fetchto a public test API and render the JSON. Watch the network panel. - Initialise npm and install nothing until you need it.
- When the file grows past a screen, move to TypeScript or be very disciplined with JSDoc. Do not wait until the bugs are mysterious.
- Read an error stack from top to bottom. The first line in your file is the one to fix.
Avoid tutorials that start by installing five tools before you have seen a variable. The language is the part that transfers.
Cautions and trade-offs
Implicit globals, forgotten await, and mutating objects you passed to another function cause most early bugs. null and undefined are both "empty" and not the same. Numbers are IEEE floats; money should not be a casual 0.1 + 0.2.
Dependency trees are deep. Commit the lockfile and audit what a package's install script can do. Client-side JS is visible to the user; never put a secret in it. Framework churn is real, but it is not an excuse to ignore the language. When a React bug confuses you, reproduce the logic in a plain function. If it fails there, it was never React.