Editor, Node.js, and your first script. Get this sorted before moving on to the language itself.
JavaScript runs in the browser, but you will also run it on your machine for testing. That means a text editor and Node.js installed locally.
Step 1: choose your text editor
You need a text editor. There are plenty of options; I use Visual Studio Code (VS Code). It is free, straightforward, and widely used. Download it from here. Use whatever editor you prefer – the important thing is that you are comfortable in it.
Step 2: install Node.js
Node.js lets you run JavaScript outside the browser – handy for testing scripts from the terminal. Download it from here and follow the installer prompts.
Step 3: hello, JavaScript
Open VS Code and create a file called hello.js:
console.log("Hello, JavaScript world!");
This prints Hello, JavaScript world! to the console. Open a terminal (Command Prompt or PowerShell on Windows, Terminal on macOS or Linux), navigate to the folder containing hello.js, and run:
node hello.js
You should see the greeting in your terminal.
Step 4: the console
The console is where output, errors, and quick tests show up. In the browser, open it via right-click, Inspect, then the Console tab (Chrome, Firefox, and Edge all work similarly).
Try typing this in the browser console:
console.log("Exploring the browser's console");
Press Enter. You have just run JavaScript in the browser.
Step 5: linking JavaScript to HTML
Create an HTML file called index.html:
<!DOCTYPE html>
<html>
<head>
<title>My first JavaScript page</title>
</head>
<body>
<h1>Welcome to JavaScript</h1>
<script src="hello.js"></script>
</body>
</html>
The <script> tag loads hello.js. Open index.html in a browser and the script runs automatically.
Step 6: browser developer tools
Modern browsers include developer tools for inspecting elements, viewing source, and monitoring network requests. Spend a bit of time clicking around – you will use these constantly once you start building pages.
Step 7: keep learning
Stack Overflow, MDN, and freeCodeCamp are all useful when you get stuck. Make mistakes, ask questions, and write code – that is how it sticks.

