JavaScript Map and Set for Pythonistas

Stephen Gruppetta 17 Lessons 3h 11m Updated intermediate js py

A Python dict keeps its keys in the order you added them, and a JavaScript object mostly does too, until the keys look like numbers. Port a waiting list keyed by member number, {214: "Dev Patel", ..., 42: "June Harris"}, take its first key with Object.keys(waiting)[0], and the plot goes to member 42, June Harris, who asked last. There’s no error.

In this course, you’ll port Rosa’s Python season report for the Brook Street Community Garden to JavaScript.

By the end of this course, you’ll be able to:

  • Choose between a Map and a plain object, and update a Map with set(), delete(), and has()
  • Count and group without Counter or defaultdict, using a Map and Object.groupBy()
  • Combine and compare Sets with union(), intersection(), difference(), and isSubsetOf() where Python uses operators
  • Build and deep-copy nested Maps and Sets with getOrInsert() and structuredClone()
  • Put the whole season report together in JavaScript

You’ll need Python’s dicts, sets, Counter, and defaultdict, plus Node 26 and JavaScript objects and arrays of objects, Object.keys() and Object.entries(), Sets, arrow functions, ??, structuredClone(), and sorting with a compare function. A few methods in the course are recent, so use Node 26. The Python examples use Python 3.15.

The course mixes short videos and text lessons with exercises, a project that ports the whole season report, and a quiz.

What’s Included:

  • 17 Lessons
  • Video Subtitles and Full Transcripts
  • Translated Subtitles in 8 Languages
  • 2 Downloadable Resources
  • Interactive Quiz to Check Your Progress
  • 5 Hands-On Coding Exercises
  • Q&A With JavaScript Experts: Ask a Question
  • Certificate of Completion

Downloadable Resources:

Related Learning Paths:

About Stephen Gruppetta

Stephen obtained a PhD in physics and worked as a physicist in academia for over a decade before becoming a programming educator. He's constantly looking for simple ways to explain complex things.

» More about Stephen

← Browse All Courses