Stories. Questions. Different perspectives.
Browse WAURE
← Advice & Questions
Education · Advice & Questions ·

How do I debug my coursework when changing several things at once has made the problem harder to follow?

Education category photographEducation

The button originally did nothing. After I changed five things, it still did nothing and the console had more messages.

I'm learning JavaScript. I have an earlier copy that worked before I added the latest feature, and the current copy with the changes. I've been searching phrases from the errors and trying fixes without writing down which change affected what. A friend offered to replace the whole script, but I wouldn't learn where my reasoning went wrong.

MDN's troubleshooting lesson shows how to use console messages and inspect a specific problem. I need to slow down enough to do that with my own work.

What would be a manageable first debugging session before I ask the tutor for help? I want to bring a clear example and the observations I can support, rather than another file whose current state I can't explain.

Discussion

5 community replies

Preserve both copies, then reproduce the problem with one clearly described input or action. Write what you expected and what happened. Start from that observation rather than another search for a fix to every message at once.

Use the console message as a clue to inspect, including the file and location it reports. Do not assume changing the named line without understanding it resolves the cause. The MDN walkthrough is useful because it follows the reasoning as well as the edit.

Try one small, reasoned change at a time and rerun the same action. Record whether the original symptom and messages changed. If you cannot explain why a proposed fix might help, that is a good point to pause and ask.

Ask the tutor what small example would let them see the issue without navigating the whole project. Include how to reproduce it, the relevant message and what you have already tried. You can ask for help investigating rather than request a replacement script.

That smaller example should still show the problem you are asking about. If it stops happening while you simplify, keep the version just before it disappeared and note the change. That observation may be useful to discuss even if you have not yet worked out the explanation.

Join the discussion

More in Education