JavaScript Lesson 1: Running JavaScript — Browser Console and Node

📎 This article includes 2 downloadable practice files ↓

⏱ 1 min read

📘 JavaScript Beginner Course · Lesson 1 of 8

In this article
  1. Node.js for scripts
  2. Where JavaScript runs
  3. Practice

You already have JavaScript: every browser runs it. Press F12 in Chrome or Edge, open the Console tab and type 2 + 3. That’s a JavaScript program.

Node.js for scripts

Install Node.js (LTS) from nodejs.org. Save code in a file and run it from a terminal:

“`javascript
console.log(“Hello from JavaScript!”);
console.log(“2 + 3 =”, 2 + 3);
“`
“`text
node js-01-hello.js
“`

Where JavaScript runs

Place Used for
Browser Interactive web pages
Node.js Scripts, servers, tools
Excel Office Scripts TypeScript, a typed JavaScript
Google Apps Script Automating Sheets, Gmail, Drive
💡 Use VS Code with the terminal open (Ctrl+`). Write, save, run with node file.js, repeat.

Practice

Run the script with Node and compare with the expected output.

📎 Practice files for this article

Free to use for learning. Files with macros (.bas) are plain text — import them with Alt+F11 → File → Import File, and always test on a copy.

✨ Ask AI about this article

Stuck on a step? Ask a question and the AI answers using this article.

Free · AI can be wrong