Congratulations, you made it to the end of the course! Rosa’s garden report now runs in JavaScript. With the seed swap finished, garden-report.js prints the same fourteen lines as garden_report.py. Plot three goes to Dev Patel, member 214, and the report closes with “Seed swap, section D: nothing yet”.
The empty section gets a line, runner beans get a zero, and the waiting list keeps the order in which people asked to join. In this course, you learned how to:
- Keep the waiting list’s number keys and insertion order with a Map, and update or check entries with
.set(),.delete(), and.has() - Choose an object for a plot’s named fields and a Map for a lookup keyed by data, then save this Map’s ordered number-and-name pairs with
JSON.stringify([...waiting]) - Count show entries in a Map, reading a missing count as zero with
?? 0, where Python’sCountersupplies the zero - Group plots with
Object.groupBy()orMap.groupBy(), and read a missing section as an empty array with?? [] - Combine Sets with
.union(),.intersection(), and.difference(), and compare their members with.isSubsetOf()and.isDisjointFrom() - Build a Map of Sets with
.getOrInsert()and deep-copy its nested data withstructuredClone(), where Python uses adefaultdict(set)andcopy.deepcopy()
Each choice lets the report answer the same question as the Python script, even when the JavaScript expression looks different.