Congratulations, you made it to the end of the course! The Millbrook Valley Weather Co-op’s readings check now runs in JavaScript. Once you added each reading’s place and the final count, readings-check.js printed the same six lines as readings_check.py. It skips the resent ridge reading, rejects school’s, and marks orchard’s failed thermometer as unchanged.
In this course, you learned how to:
- Compare records by the fields that identify them, such as the name
"ridge #1412", because===and.includes()compare objects by identity - Explain why strings, numbers, and Booleans compare by value: they’re primitives, which can’t change, and their methods come from wrapper objects that JavaScript creates and throws away
- Pair
typeofwith the checks it can’t make:!== nullfor objects,Array.isArray()for arrays, andNumber.isNaN()to rule outNaN, whichtypeofcalls a number - Check an object’s class with
instanceof, and negate the whole test, as in!(reading.takenAt instanceof Date) - Read
==by its rules, and replace it by checking for a missing value first, then converting and comparing with=== - Choose between
===andObject.is()whenNaNor-0is involved
Keep the Habits That Carry Over
You ported most of the readings check line by line. Its logic stayed the same, and only the comparisons and type checks changed.