Help a Friend Whose Script Won't Work

Your snack calculator runs, and you’ve already fixed one mistake in it on purpose. Now imagine your friend Maya is building the same calculator on her own computer, and she messages you because her script won’t do what she wants. Helping someone else is a good test of what you’ve learned, because you have to work out the problem from what she tells you instead of from your own screen.

In this short session, you’ll sort out three of Maya’s problems. Each one has a different cause you’ve met in this course, and telling them apart is the skill you’ll practice. After that, you’ll explain your own popcorn line and make one small change to it. Plan on about ten minutes, with snacks.js open in VS Code.

Help Maya With the Mentor

The button below opens a new mentor conversation. The mentor plays Maya and tells you about one problem at a time: what she did and what her terminal showed. You can ask her questions, such as what her tab or her prompt shows, before you say what went wrong and what she should do. If you get stuck, the mentor gives you a hint before revealing the answer.

Once Maya’s script works, the mentor asks you to paste your own popcorn line from scratch/snacks.js and explain it in your own words. Then you’ll change one number, predict the result, run your script, and paste what the terminal printed. The mentor can’t see your files or run your program, so it works only with what you paste or describe.

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.