JavaScript Lesson 1: Running JavaScript β€” Browser Console and Node

JavaScript Lesson 1: Running JavaScript β€” Browser Console and Node featured illustration

πŸ“Ž This article includes 2 downloadable practice files ↓

⏱ 1 min read

πŸ“˜ JavaScript Beginner Course Β· Lesson 1 of 8

Advertisement
In this article
  1. Node.js for scripts
  2. Where JavaScript runs
  3. Practice
  4. Continue learning

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:

console.log("Hello from JavaScript!");
console.log("2 + 3 =", 2 + 3);
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.

Advertisement

πŸ“Ž Practice files for this article

⬇ Download all 2 files (ZIP Β· 396 B)

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