Course Summary

Your first days at The Second Draft started with a shop you’d never seen and ended with a page Grace can hand the next new hire. Along the way, you answered her questions about the confirmation, the two prices, and READ20.

You also explained why Mei Tan’s READ20, WELCOME10 got “Unknown or inactive discount code” instead of “Use one discount code”. The one-code check in chooseCode() only catches an array, and the staff desk sent one string that findDiscount() couldn’t find. You did all of that without reading the whole codebase, and nobody expected you to.

What You Can Do Now

You can explain how a feature of an unfamiliar codebase works, from the user’s action to the stored data, naming the files, the functions, and the rules the code relies on. You can also check that explanation, including one from Code Mentor, against the code and the results of a run.

For the discount code, that meant tracing a path from the staff desk’s order form through chooseCode(), priceOrder(), and findDiscount() to the order saved in data/shop.json. Each step rested on a line you found and a run that confirmed it. You built that from a routine you can take into any project:

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.