Congratulations, you made it to the end of the course! Kestrel Print’s backup check now runs in JavaScript. On the new server, where nobody set BACKUP_BUCKET, backup-check.js refuses to start and exits with status 1, as the Python check does, instead of backing up to a bucket called undefined.
With the warning and the debug line added, it prints the same lines as the Python check in all three runs, except that the debug line reports the bucket’s type as string where Python says str.
In this course, you learned how to:
- Declare each name once, with
constby default andletonly for a name the code reassigns, such as the status line and the warnings count - Declare a name at the level where it’s read, such as
let mode;before theifthat sets it, because aletorconstdeclared inside braces lives only inside them - Check a value’s type with
typeof, compare the answer with a type name in quotes, and spot an array withArray.isArray() - Tell
null, the empty value code sets on purpose, fromundefined, the one an unset variable or a missing property gives you, and catch either with== null - Check for an empty string with
!, an empty array by its.length, and an empty plain object by counting the keys returned byObject.keys() - Convert text with
Number()once, where it comes in, and compare with===and!==