JavaScript’s loops look familiar to a Python programmer, and that’s the trouble: loops are where Python habits trip you up, often without an error. Port Python’s for delay in delays: to JavaScript, keep the word in, and JavaScript prints the positions 0, 1, and 2 instead of the delays.
In this course, you’ll port a night-bus operations team’s morning report from Python to JavaScript, one loop at a time.
By the end of this course, you’ll be able to:
- Loop over items with
for...of, and tell it apart fromfor...in - Count without
range()using the classicforloop - Loop with
whileanddo...while, and search withoutfor...else - Loop over positions, pairs, objects, and Maps
- Spot a Python habit in a JavaScript loop, whether you or an AI assistant wrote it
You’ll need Python loops, enumerate(), zip(), and looping over a dictionary, plus Node 26 and the JavaScript basics: const and let, arrays, and objects. The Python examples use Python 3.15.