Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Interactive Web Pages with JavaScript Traversing and Manipulating the DOM with JavaScript Perform: Traversing Elements with children

diannalord
diannalord
7,284 Points

How can one step through the code?

I want to see or confirm how the function bindTaskEvents works as it gets used in 5 different ways. I also want to see what the parameters get set to each time the function gets called.

Thas Eagans
Thas Eagans
Courses Plus Student 2,533 Points

Add

document.write();

into the loop. I'm assuming you have a loop inside the function?

</TREagans>

2 Answers

I add console.log(); statements all over the place when I'm trying to understand what's happening while traversing the DOM just to make sure. Once I'm confident I know what's happening, I comment out the console.log so that I can I use it later if needed.

Milo Winningham
seal-mask
.a{fill-rule:evenodd;}techdegree
Milo Winningham
Web Development Techdegree Student 3,317 Points

console.log() and document.write() are often the fastest way to see what's happening in your code, but it's worth learning your browser's development tools as well. The Debugging a Web App With Chrome Dev Tools workshop will show you how to do this and much more!

diannalord
diannalord
7,284 Points

That workshop was fantastic! I think Website Optimization covers some of the same information and expect to learn more on debugging in that course too. Thanks!