Before writing JavaScript, you need to master the basics of HTML, programming logic, and prepare a modern toolchain such as Node.js, a code editor, and a browser. In this episode you will also create your first JavaScript project and verify your entire working environment.

Welcome to the Learn JavaScript series! This series will take you from mastering JavaScript — the core programming language for interactive web development — from basic syntax to modern development patterns for production. There are 23 episodes in total, organized into four phases, and all of them depend on the foundation we build in this episode 0.
Before writing your first line of JavaScript, there are several basic skills and software you must have. Why do these prerequisites matter? Because JavaScript does not stand alone: it runs inside browsers, executes on servers via Node.js, and is surrounded by a massive tooling ecosystem. If your environment isn't ready, every following episode will feel painful and your results will be hard to verify.
Episode 0 is your roadmap: we'll make sure your basic skills are in place, set up Node.js, a code editor, and a browser, then create and verify your first JavaScript project. Once this episode is done, the entire series can be followed comfortably and without technical obstacles.
JavaScript is a language that lives inside web pages, so you must understand how HTML works. You don't need to be an HTML expert, but you must know the basic document structure, elements like body and script, and how to inspect a page through your browser's DevTools. Without this understanding, episodes 13 to 18 about the DOM and user interactions will feel like holding text without context.
Get into the habit of opening DevTools in Chrome or Firefox. Use the F12 shortcut to open the panel, then the Console tab to run JavaScript directly:
console.log("Hello from DevTools");The Console will respond with that string. console.log("Hello from DevTools") is the most basic way to see output — you'll use it in almost every episode.
JavaScript is a language with strict logic: variables, branching, loops, and functions. You must be comfortable thinking algorithmically — reading a problem, breaking it into small steps, and writing it as code. It doesn't matter if your first language wasn't JavaScript; the way of thinking transfers.
If you're a complete beginner at programming, don't worry. The four phases of this series are built in order: syntax in episodes 1 through 6, more abstract concepts in episodes 7 through 12, and only then do we move into the interactive web. Episode 0 just makes sure your toolkit is complete — it's not testing your understanding.
Node.js is the runtime that runs JavaScript outside the browser. npm is the package manager that comes with Node for installing libraries and tools. Both must be installed before episode 1. Download the LTS version from the official Node.js website, then verify:
node --version
npm --versionThe output of node --version shows the runtime version, for example v22.x, while npm --version shows the package manager version. Both should return a version number, not an error. If you see a "command not found" message, make sure the Node installation path is already in your system's environment variables.
You need a capable code editor. The top recommendation is VS Code — free, cross-platform, and with an excellent JavaScript extension ecosystem. Install the Prettier and ESLint extensions now; both will be used seriously in episode 20.
For the browser, use Chrome or Firefox as your primary development browser. Both have complete DevTools that we'll use in episodes 13 through 19. Don't use a browser without modern DevTools, because debugging JavaScript in production depends on these facilities.
Open a terminal and create a new project directory:
mkdir belajar-javascript
cd belajar-javascriptThen initialize the project as a Node package:
npm init -yThe command npm init -y creates a package.json file — the center of configuration for any modern JavaScript project. This file will contain the package name, version, and scripts that we'll discuss starting from episode 10. You can check the result with:
{
"name": "belajar-javascript",
"version": "1.0.0",
"main": "index.js"
}Create an index.js file in the same directory with one line of content:
const sapa = "Halo, JavaScript!";
console.log(sapa);const sapa = "Halo, JavaScript!" declares a constant whose value cannot be changed — you'll learn the difference between let and const in episode 2. Now run the file with Node:
node index.jsThe output Halo, JavaScript! in the terminal indicates the whole chain works: the file was written, read by Node, executed, and the result came out.
Before moving on to episode 1, run a full verification in a single sequence to make sure everything is ready:
node --version
npm --version
node -e "const jawaban = 6 * 7; console.log('Jawaban:', jawaban)"The last line uses node -e to execute code without a file — a quick way to test the runtime. If all three commands run without errors, your environment is complete. Keep the following list as a checklist:
node --version.npm --version.node index.js.If anything isn't in place yet, stop and complete it before continuing. A strong foundation will make the next 22 episodes feel much lighter.
In this episode 0 you've prepared the footing for the entire series: making sure your basic HTML and programming logic skills are solid, installing Node.js and npm, setting up your code editor and browser, creating your first JavaScript project, and verifying that the entire toolchain chain works.
Key takeaways:
node --version and npm --version must return versions, not errors.npm init -y creates a package.json file as the center of project configuration.node index.js runs your first JavaScript file.In the next episode 1 we'll cover an introduction to JavaScript and its ecosystem — the history of the language's birth, the relationship between JavaScript and ECMAScript, the role of Node.js and npm, and why JavaScript became the language that runs almost everywhere. Make sure your environment is ready, because the Learn JavaScript journey is just beginning!