AETERNAE AI RESEARCH LLC INDEPENDENT RESEARCH
ÆAETERNAERESEARCH
Sign inRequest access
← Malware catalog

Attributed metadata history

REPORTPUBLIC METADATA

JavaScript from absolute zero · 3. Making decisions: conditions and the traps

JavaScript from absolute zero · Chapter 3 of 14 · Languages · new chapter every Tuesday morning By the end of this chapter: Write correct conditional logic and avoid the comparison mistakes the language invites. The problem Say you are a junior developer at a regional airline. You have been tasked with writing a small script for the check-in desk that calculates baggage fees. The rule is simple: if a suitcase weighs more than 20kg, the passenger must pay a £40 surcharge. If it is 20kg or less, it is free. You write a script that takes the weight and prints the result. However, because you haven't yet mastered how to make the computer choose between two paths, your script prints "Surcharge applied" for every single passenger. On a busy Saturday morning at Gatwick, 400 passengers check in. The staff, following the script's output, charge every person £40, including those with small carry-on bags. By 10:00 AM, the customer service desk is swamped with 150 angry travellers demanding refunds. The airline has to issue £6,000 in immediate refunds, and you are called into a meeting to explain why the "automated" system cannot tell the difference between a 5kg backpack and a 30kg trunk. The cost wasn't just the money; it was the loss of trust from the ground staff who now refuse to use your software, reverting to pen and paper. To fix this, you need to move beyond code that runs in a straight line and learn how to make the computer branch. Before you start You must have Node.js installed on your computer, as covered in Chapter 1. You should be comfortable creating a new text file and running it from your terminal (the command-line interface). To verify your setup, open your terminal and type: node -v You should see a version number, such as v20.10.0 or v22.0.0. If you see an error saying "command not found", return to Chapter 1 to complete the installation. How do we ask the computer a question? In Chapter 2, we learned about types like Strings (text) and Numbers. To make decisions, we use a third type: the Boolean. A Boolean can only ever be one of two values: true or false. We create Booleans by using comparison operators. These are symbols that compare two values and return a result. Open your terminal, type node to enter the interactive mode, and try these comparisons: 25 > 20 // Output: true 15 > 20 // Output: false The > symbol means "greater than". Because 25 is larger than 20, the computer evaluates that expression (a piece of code that produces a value) as true. Here are the primary comparison operators you will use: > : Greater than < : Less than >= : Greater than or equal to <= : Less than or equal to === : Is exactly equal to !== : Is not equal to Note the triple equals ===. In JavaScript, we use a single = to assign a value to a variable (e.g., let weight = 25). We use the triple equals === to ask if two things are the same. This is the most common source of bugs for beginners. How do we branch the path? To use these "true or false" answers, we use an if statement. An if statement tells the computer: "If this condition is true, run the code inside these curly braces. If it is not, skip it." A condition is simply any expression that results in a Boolean (true or false). The structure looks like this: if (weight > 20) { console.log("Surcharge applied"); } If the weight is 25, the code inside the { } (called a block) runs. If the weight is 10, the computer ignores everything inside the braces and moves to the next line of the script. To handle the "otherwise" scenario, we use the else keyword. This creates a second block of code that only runs if the first condition was false. if (weight > 20) { console.log("Surcharge applied"); } else { console.log("No fee"); } This is a binary decision. One of these two blocks will run, but never both. Why is === better th

Reference details

Source category
research-report
First reported
Nov 28, 2026 05:45 UTC
Last reported
Nov 28, 2026 05:45 UTC
Catalog updated
Nov 28, 2026 05:56 UTC
Record ID
b915241311229e407ba452f866c339b3526f3a8332c11a7b8dc22bfb03d453ac

Published indicators

Network indicators are visibly defanged. This page does not make them clickable or send them to another service.

No validated file hashes or network indicators are stored for this record.

Source observations

intelligence_src_6dc544294b7f21f98a

Source-provided label
Publisher RSS metadata
Evidence class
mentioned in report
Confidence
Not reported
Observed
Nov 28, 2026 05:45 UTC
Retrieved
Nov 28, 2026 05:56 UTC

This record contains metadata and attribution only. It does not host, download, unpack, render, or execute malware samples.

Feed collection status

Sources represented on this page. Publication and observation dates describe the content; successful batch dates describe local collection. A recent batch does not certify complete coverage or current provider availability.

1 sources: 0 stale, 0 needing attention, 0 paused, 0 unverified.

Review source update dates and status
  • intelligence_src_6dc544294b7f21f98aRecent successful batchLast successful batch: Last attempt:

Stale means older than twice the recorded collection interval, with a minimum of one hour; without an interval, the threshold is 24 hours. Cached content remains available while a feed is stale, paused, or unverified.