Explain Your Supply Checker

Your supply checker is done. In Check the Supply Names and Check the Supply Weights, the tests confirmed that your four functions return the right answers, including for empty lists and lists where nothing matches. Nice work!

Passing tests tell you what your code returns. This review is about why it returns that. Can you say why a counter starts at 0, why for...of was enough, and how counting every crate differs from counting the crates that match? Those explanations let you change the checker later without starting over, so this last project step asks you to put them into words and then make one change you haven’t seen yet.

Talk Through Your Checker With the Mentor

The button below opens the mentor chat in a new conversation, already started with your request for a review. The mentor then runs a short review of about ten minutes, asking one question at a time and waiting for your answer before it moves on.

You’ll explain where your functions start and why, choose between two loops for a new task, spot the difference between counting all crates and counting matches, and adapt the label rule to a new question. If an answer doesn’t come, the mentor offers a hint or a smaller list to try, and explains the answer only after your second attempt. At the end, you get a short summary of what you explained well and what’s worth another look.

Locked learning resources

Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Already a member? Sign-In

Locked learning resources

The full lesson is for members only. Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Already a member? Sign-In

Become a Member to join the conversation.