Released · improving
Programming language · Since 1995
JavaScript is a dynamic programming language standardized as ECMAScript that runs in every web browser and in runtimes such as Node.js.
JavaScript was created in 1995 to add behavior to web pages and is now defined by an international standard called ECMAScript. Every major web browser ships with a JavaScript engine, so you can run it without installing anything, and runtimes such as Node.js have made it just as common outside the browser.
Its best-known home is the web front end, where it handles the page and user input. Asynchronous programming built on the event loop, Promises and async/await also makes it a good fit for network-heavy servers and APIs, and the npm ecosystem offers libraries for almost any task. Many languages and tools, TypeScript among them, build on JavaScript.
Open the developer tools console in your browser and you can start experimenting right away. To run programs saved as files, install Node.js. Learn variables, functions, objects and arrays first, then move on to asynchronous code and modules; MDN and javascript.info are excellent places to begin.
Built into every major browser, and runtimes such as Node.js, Deno and Bun let you use the same language on servers and the command line.
Variables carry no type declarations and functions are first-class values. A class syntax sits on top of prototype-based objects.
The event loop, Promises and async/await keep programs responsive while they wait on the network or file I/O.
The TC39 committee revises the ECMAScript standard every year with a strong commitment to backward compatibility, and npm hosts a vast number of packages.
Download the LTS installer for your operating system from nodejs.org. On macOS and Linux you can use a version manager such as nvm instead; on Windows, winget works too.
Open a new terminal and confirm that the Node.js version is printed. The npm package manager is installed alongside it.
node --versionIn an empty folder, create a package.json to manage dependencies and scripts.
npm init -yconsole.log writes its arguments to standard output (the developer tools console in a browser). Save the code as hello.js and run node hello.js to see Hello, World! printed. You can also paste the same line into a browser console.
hello.js
console.log("Hello, World!");
node hello.jsSix chapters that take you from installation to the core ideas of JavaScript.
Ask questions, share experience and trade opinions about JavaScript.
No discussions yet. Start the first one.
0 comments
Sign in · Sign in to leave a comment.
Be the first to comment.