What is JavaScript, and what is it actually used for?
JavaScript is a high-level, dynamically typed programming language. Brendan Eich created it at Netscape in 1995, and Ecma International later turned it into a standard called ECMAScript. That standard is the language itself, and JavaScript is simply the most widely used version of it. The small differences between browsers are tracked in a public compatibility table, so you can always check which features are safe to use.
What makes this language unusual is where it runs. Because every browser ships with it, the same file can change a page, react to a click, and send data to a server without any build step and without installing anything extra. The same syntax also runs on servers through Node.js, Deno, and Bun. It runs inside mobile apps through React Native, at the edge of the network through services such as Cloudflare Workers, and even inside databases, because MongoDB queries are written in a dialect of JavaScript.
In real projects you meet it in three layers. The first layer is the presentation code that changes what the user sees on the screen. The second layer is the application logic that holds the rules of the business. The third layer is the transport code that moves data over HTTP. In an interview, the interviewer usually cares less about the history and more about whether you can pick the right runtime for a job, and whether you can write code that behaves in the same way in a browser tab and in a server process.