Explain Your Movie-Night Picker

Tomás’s picker now prints its shortlist, and the exercise tests agree with every line. However, a passing test only shows that your code returns the right values. It doesn’t show that you could tell a friend why it works or change it with confidence when Tomás asks for something new.

In this review, you’ll explain your own picker to your mentor, one callback at a time, saying who calls it, what it receives, and what it returns. Then you’ll make a change to the picker that you haven’t seen before and check the result. Start by opening your picker where you can read it and run it.

Get Your Picker Ready

The session focuses on the code you wrote, so have it in front of you before you start. You’ll paste it into the chat, and you’ll need to run it again after your change.

If you built the picker in picker.js on your own computer, open that file. If you wrote it only in the exercises, copy your six functions from Exercise: Print the Shortlist into a new picker.js, below the watchlist array from the project brief.

You can drop the export at the start of each function: it’s only there so the exercise’s tests can reach your code, and Node runs the file either way. Then add a call to printPicker() at the bottom of the file:

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.