J

JavaScript Tutorial

Clean • Professional

Setting Up the Environment

2 minute

Setting Up Your JavaScript Environment

To start coding JavaScript, you need a few simple tools. No fancy setup required!

Browser Console: Your Instant JavaScript Playground

The Browser Console is a built-in tool in every modern browser (Chrome, Firefox, Safari) that lets you run JavaScript instantly—no installation required!

Think of it as a sandbox where you can test JavaScript code right away. It’s perfect for beginners to experiment and learn.

How to Access the Console

  1. Open any webpage in your browser.
  2. Right-click anywhere and select “Inspect” (or press F12).
  3. Click the Console tab.

Try It Yourself

Type the following and press Enter:

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

Try another fun example:

alert("Welcome to coding!");

Why Use the Browser Console?

  • No setup required—start coding instantly.
  • Perfect for quick tests, debugging, and learning JavaScript basics.

Node.js: Run JavaScript Anywhere

Node.js lets you run JavaScript outside the browser, directly on your computer. This is useful for practicing, building apps, or writing server-side scripts.

Node.js turns your computer into a JavaScript powerhouse, allowing you to:

  • Write scripts for servers
  • Build web or desktop apps
  • Practice coding locally

How to Install Node.js

  1. Visit nodejs.org and download the LTS (Long-Term Support) version—stable and beginner-friendly.
  2. Follow the installer steps (just click “Next” until finished).
  3. Open your terminal (Command Prompt, PowerShell, or VS Code terminal) and type:
node -v

You should see the Node.js version, like v20.x.x.

Try It Yourself

Create a file named test.js with this code:

console.log("Hello from Node.js!");

Open your terminal, navigate to the folder containing test.js, and run:

node test.js

Why Use Node.js?

  • Practice JavaScript without a browser.
  • Build backend applications or small scripts.
  • Test code locally before using it on websites or apps.

Visual Studio Code (VS Code): Your Coding Home

Visual Studio Code (VS Code) is a free and beginner-friendly code editor that makes writing JavaScript fun and easy.

  • Helps you write, organize, and run JavaScript efficiently.
  • Offers error highlighting, auto-suggestions, and extensions to make coding faster.

How to Install VS Code

  1. Download VS Code from code.visualstudio.com.
  2. Follow the installer (it takes just a couple of minutes).
  3. Open VS Code and create a new file, for example, script.js.

Try It Yourself

Write this code in script.js:

let name = "Alex";
console.log("Hello, " + name + "!");

Save the file. Open the terminal in VS Code (Terminal → New Terminal) and run:

node script.js

 

Article 0 of 0