Congratulations, you made it to the end of the course! The bookkeeper’s month-end script now runs in JavaScript, next to the roastery’s order dashboard. For October’s export, invoices.js prints the same fourteen lines as invoices.py, from October 2026: 72.0 kg in 8 orders, 6 drum loads down to the order number next month’s export starts at.
In the last exercise, you added that final line, one after the newest order in this export, so the port matches the Python version for October and for every other month the tests made up. Every weight, cent, share, and nineteen-digit order number on the invoices now agrees with Python’s, digit for digit.
In this course, you learned how to:
- Keep measured values in whole units, such as grams, so a
+=loop adds them exactly, up to2 ** 53, and the drum loads come out at six - Compare computed floats with a tolerance that comes from the data, like half a scale reading, instead of
Number.EPSILON - Keep money in integer cents where Python used
Decimal, round once per café, and divide by 100 only on the output line - Keep big IDs as text with a
JSON.parse()reviver that returnscontext.source, and test that a whole number is still exact withNumber.isSafeInteger() - Do exact big-integer arithmetic with BigInt, built from text, and convert to and from it at the edges
- Check results with
Number.isFinite()before they reach a report line, sincenumberarithmetic returnsNaNorInfinitywhere Python raisesZeroDivisionError - Make
Intl.NumberFormatround, sign, and label numbers as Python’s format specs do, withroundingMode,signDisplay,style: "unit", and a locale