Skip to content

Setting Up Your Development Environment

To write and run JavaScript, you need a code editor and a JavaScript runtime.

Code Editor: Popular choices are Visual Studio Code, Sublime Text, or Atom. VS Code is highly recommended because of its extensions and built‑in terminal.

Browser Console: Every modern browser includes developer tools with a console. Press F12 (Windows/Linux) or Cmd+Opt+I (Mac) to open it. You can type JavaScript directly and see results immediately.

Node.js: To run JavaScript outside the browser, install Node.js. After installation, open a terminal and type node -v to verify. You can execute a script with node filename.js.

Optional – Code Formatter: Install Prettier in your editor to keep code consistent.

Example of running a simple script in Node.js:

console.log("Hello, world!");

Then run :

Terminal window
node hello.js