Introduction
What is JavaScript?
JavaScript is the programming language of the web. HTML builds the page, CSS styles it, and JavaScript makes it do things: respond to clicks, validate forms, load new data and much more.
console.log("Hello, JavaScript!");Output
Hello, JavaScript!
What can JavaScript do?
- Change the page instantly: show menus, open pop-ups, switch tabs, toggle dark mode.
- React to the user: clicks, typing, scrolling, dragging.
- Check forms before they are sent.
- Load data from servers without reloading the page (like new messages in a chat).
- Build games, charts and animations.
- Run on servers (Node.js), in mobile apps (React Native) and desktop apps (Electron).
JavaScript is not Java
Despite the name, JavaScript and Java are completely different languages. The name was a marketing decision in 1995.