Rullst AcademyRullst Academy/Lesson
JavaScript and interaction · Lesson 10 / 14

Errors with evidence

Finding an error is a chance to turn an assumption into a test.

Learning paths14 min

Let's discover together

  1. 1

    A SyntaxError can prevent parsing; ReferenceError can indicate an unknown name; TypeError can arise from an incompatible operation. Read message, file and line; the cause may precede the reported position.

  2. 2

    Reproduce with the smallest failing input. Write expected and observed results before editing. A logic error may not throw: adding strings instead of numbers can be valid for the engine but wrong for the rule.

  3. 3

    try/catch handles a failure you know how to interpret; an empty catch hides information. Show a useful message and keep appropriate development details without logging passwords or personal data.

  4. 4

    Open tests.html. In core.js, change number > 120 to number >= 120. The 120 case should fail; restore it and confirm it passes. A test that detects a mutation demonstrates more than a green screen alone.

From the example to your own interaction

Download this activity kit, extract it and open index.html in a browser. Edit lesson.js, save and reload. You do not need Node or packages. README explains local HTTP when needed.

The demonstration uses supplied JavaScript. It does not execute your editor code. Download your edit separately to test in the local kit.

My files and GitHub
Try the project we will build

Small mission planner

Create, complete and review a study plan using fictional data. Missions stay only in this page’s memory and disappear on reload.

Use a short title without personal data and whole minutes from 1 to 120. Up to 20 missions.

Missions in the plan
0
Minutes across all missions
0
Completed missions
0

No missions in this filter. Add one or choose another filter.

    Suggestion lab

    Scenarios are simulated in this browser by default. No suggestion request is sent and your plan is not replaced.

    Available in the kit opened at http://127.0.0.1:8768. See README; no external account is needed.

      This JSON contains only missions, not your code. The demonstration does not import files or synchronize devices. Download edited JavaScript from the lesson file workspace.

      Official links and next step

      ✦
      YOUR MISSION

      Read a failure, create a minimal case and verify a fix without hiding the problem.

      Now it's your turn

      Discovery workshop

      Think before running

      The requirement accepts 120. The changed implementation rejects number >= 120.
      Build your answers and check when you are ready.
      A moment to understand

      Does no exception prove the rule is correct?

      I need a hint

      Predict the result, run your file and explain the difference.

      Loading your journey…

      Take it with you

      Add a test that fails after a deliberate change and passes after restoration. Record requirement, mutation and result.

      At your own pace

      My files and GitHub

      Every lesson can become your own record: code, notes or a practice plan. Saving a file to GitHub is optional and does not change your XP.

      Student guide

      The editor and downloads open when this lesson is available to your account. Check access below or return to the track map.

      Checking your access to this lesson…

      Rullstpetbot

      AI can make mistakes. Check the lesson material.