1. What is JavaScript and where is it commonly used?
JavaScript is a programming language mainly used to make websites interactive and dynamic. It runs inside web browsers and can also run on servers using technologies like Node.js. It is one of the core technologies of web development along with HTML and CSS.
Example: When you click a button and a popup appears on a website, JavaScript is usually handling that action.
button.addEventListener("click", () => {
alert("Button clicked!");
});