In this video, you asked Code Mentor one specific question about findDiscount(), split its reply into claims, and marked each claim confirmed, wrong or unchecked from a line of code and a run on the staff desk.
Key Points
- Code Mentor can be a second reader. Treat its answer like a colleague’s notes. They’re useful, but you check them before you pass them on.
- Asking it to explain the whole codebase gets you an overview that sounds right but gives you nothing to check.
- A useful question asks about one behavior, gives the code it’s about, and asks for the line behind each claim. The button below brings the code along. For your own questions, paste the function’s code under the question.
- The reply in the video is an example, written for it. Yours will differ, and it may get different claims right or wrong. Split any reply into claims: single statements about what the code does, each true or false on its own.
- Give each claim one of three marks:
- Confirmed: The line says it, and a run shows it.
- Wrong: The line or a run contradicts it.
- Unchecked: You don’t have both yet. Write down what’s missing.
- Unchecked isn’t wrong. It stays an assumption until a question of yours depends on it.
- When a claim is wrong, tell Code Mentor which line contradicts it, and check its next answer the same way.
Ask One Specific Question
The question in the video was about findDiscount() in src/discounts/codes.js. The button after the code opens Code Mentor with the same question typed in and this code included. Send it, and keep the reply open. Here’s the code, with the long line 5 broken in two to fit: