JavaScript code has a different shape from Python’s. Its blocks, statements, line breaks, and names follow their own rules, and code that looks right by Python’s rules can run differently. Here’s the bug check from a release-note script on a day with no open bugs, first in Python:
BUGS_OPENED = 9
BUGS_CLOSED = 9
open_bugs = BUGS_OPENED - BUGS_CLOSED
print(f"Open bugs: {open_bugs}")
if open_bugs > 0:
print("Please check the bug tracker.")
print("Triage call at 9:30 tomorrow.")
Python prints Open bugs: 0 and skips both lines under its if. Here’s a JavaScript port, indented the same way:
const BUGS_OPENED = 9;
const BUGS_CLOSED = 9;
const openBugs = BUGS_OPENED - BUGS_CLOSED;
console.log(`Open bugs: ${openBugs}`);
if (openBugs > 0)
console.log("Please check the bug tracker.");
console.log("Triage call at 9:30 tomorrow.");
When you run it with no open bugs, it still prints the second line, and there’s no error:
Open bugs: 0
Triage call at 9:30 tomorrow.
This course shows you why, and how JavaScript developers write code that runs the way it reads.
You’ll help a small web agency that ships to its clients’ sites most afternoons. Whoever ships last edits a few settings at the top of a script, runs it, and pastes the release note into the client’s channel. Today the client is Fernleaf Bakery, the version is 2.4.1, and Maya is deploying. The agency is moving its tools to JavaScript, and you’ll port the script one kind of line at a time.
By the end of this course, you’ll be able to:
- Read and write blocks by their braces, including empty ones
- Comment and document code with
//,/* */, and JSDoc blocks - End statements and break long lines without changing what the code does
- Tell expressions from statements, and avoid an assignment slipping into a condition
- Name things the JavaScript way, and let a formatter decide the style
- Port a short Python script to JavaScript, line by line
You need to know how to write Python comfortably, have Node installed, and know a little JavaScript:
declaring names with const and let, writing an if, and writing a function. The examples
use Node 26 and Python 3.15, and a current version of each is fine.
The course mixes short videos and text lessons, with exercises where you write the code yourself. Every video has a summary below it, so you can review without rewatching. A project ports the whole release note, and a quiz and a summary close the course.
Next up: Reading Blocks by Their Braces, where you find out why that second line ran.