OpenViSTAI · Agents · Blockchain · Crypto
Menu

OPENVIST LEARN · FREE LESSONS

JavaScript foundations: browser basics and a tested Node CLI

Twenty-five practical beginner lessons: JavaScript values, collections, functions, classes, modules, promises, a browser event, local files and tests, ending with a bounded Node JSON reporting tool.

JavaScript source can run in a browser or in Node.js, with different host APIs.

What you will build

Learn JavaScript step by step in Node.js, then connect a real browser button to an event listener. Finish with a downloadable local JSON reporting project and automated tests.

The reference runtime is Node.js 24. Source files use .mjs modules. Most examples run in your terminal; the browser lesson provides a separate self-contained HTML file. Shell commands work in Bash or PowerShell unless a more specific label is shown.

Allow about 8–11 hours including exercises. Work in a fresh practice folder and keep earlier examples under their own names. No external npm packages, account, VPS purchase or paid API is required.

This is a foundations route, not the entire JavaScript ecosystem. Frameworks, HTTP clients, TypeScript, advanced browser tooling and production deployment need separate lessons. Reading or copying code on OpenViST does not execute it.

Your learning path

  1. LESSON 1 · 15 MIN

    JavaScript in the browser and in Node.js

    Choose the right runtime and run a saved JavaScript file without confusing it with a shell command.

    Open lesson →
  2. LESSON 2 · 20 MIN

    const, let and readable names

    Store values and distinguish reassignment from changing an object.

    Open lesson →
  3. LESSON 3 · 20 MIN

    Types, missing values and strict equality

    Recognise primitive values and avoid accidental coercion in comparisons.

    Open lesson →
  4. LESSON 4 · 25 MIN

    Numbers and explicit conversion

    Check numeric input without accepting a partially parsed value by accident.

    Open lesson →
  5. LESSON 5 · 20 MIN

    Strings, templates and Unicode length

    Format messages and understand what string.length counts.

    Open lesson →
  6. LESSON 6 · 20 MIN

    Conditions, booleans and clear branches

    Write decisions that show which values are accepted.

    Open lesson →
  7. LESSON 7 · 20 MIN

    Arrays and shared references

    Read and change ordered values while noticing when two names share one array.

    Open lesson →
  8. LESSON 8 · 20 MIN

    Loops and bounded repetition

    Repeat work while keeping the accumulator and stopping rule visible.

    Open lesson →
  9. LESSON 9 · 20 MIN

    Objects, fields and own properties

    Use named fields without confusing a missing value with an inherited property.

    Open lesson →
  10. LESSON 10 · 20 MIN

    Maps, sets and counting categories

    Choose collections that make membership and dynamic keys explicit.

    Open lesson →
  11. LESSON 11 · 20 MIN

    Functions, scope and return values

    Name a small rule and keep its calculation separate from display.

    Open lesson →
  12. LESSON 12 · 20 MIN

    Classes and instance state

    Group a small amount of related state and behaviour without overcomplicating a program.

    Open lesson →
  13. LESSON 13 · 20 MIN

    Destructuring, spread and defaults

    Read named fields concisely while recognising a shallow copy and a missing value.

    Open lesson →
  14. LESSON 14 · 20 MIN

    Callbacks, map, filter and numeric sorting

    Pass a small function to an array operation and understand whether the input changes.

    Open lesson →
  15. LESSON 15 · 20 MIN

    Errors, stack traces and deliberate recovery

    Read the failing operation and handle expected errors without turning them into fake success.

    Open lesson →
  16. LESSON 16 · 20 MIN

    Modules, imports and file names

    Put a reusable function in another file and import it without mixing module formats.

    Open lesson →
  17. LESSON 17 · 25 MIN

    Promises, async and await

    Follow asynchronous work without assuming that starting it means it has finished.

    Open lesson →
  18. LESSON 18 · 25 MIN

    A browser page: DOM, events and text

    Use a separate local HTML file to connect a real button to a JavaScript event listener.

    Open lesson →
  19. LESSON 19 · 25 MIN

    Node paths and text files

    Use Node’s filesystem APIs and choose a write mode intentionally.

    Open lesson →
  20. LESSON 20 · 25 MIN

    JSON syntax and data contracts

    Parse JSON as data, then check whether its shape matches the program you intend to run.

    Open lesson →
  21. LESSON 21 · 25 MIN

    CLI arguments and exit status

    Make a command repeatable and separate report data from failure messages.

    Open lesson →
  22. LESSON 22 · 25 MIN

    Automated tests with node:test

    Turn expected behaviour and rejection cases into repeatable checks without installing a testing package.

    Open lesson →
  23. LESSON 23 · 20 MIN

    npm, packages and project boundaries

    Know when a package is needed and avoid running installations merely because an import failed.

    Open lesson →
  24. LESSON 24 · 40 MIN

    Project: build a tested local JSON reporting tool

    Combine modules, validation, async file reads and a clear command-line boundary.

    Open lesson →
  25. LESSON 25 · 30 MIN

    Project: regression tests and your next practical step

    Check normal results and rejection cases, then compare the tool with a real recipe’s own contract.

    Open lesson →