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 Express Basics (2015) Developing Express Apps Like a Boss Interactive Debugging and Exploratory Programming

Anthony c
Anthony c
20,907 Points

Not clear on why I would want to set a breakpoint

What does a breakpoint tell me?

Where are the best places for breakpoints?

Alternative resource suggestions welcome!

2 Answers

Tim Larson
seal-mask
.a{fill-rule:evenodd;}techdegree
Tim Larson
Full Stack JavaScript Techdegree Student 13,696 Points

Breakpoints are a great tool for identifying sections of your code that may be problematic.

While debugging, having breakpoints to segment different functions from one another will save you loads of time identifying where your problem(s) lie.

"A breakpoint is a signal that tells the debugger to temporarily suspend execution of your program at a certain point. When execution is suspended at a breakpoint, your program is said to be in break mode. Entering break mode does not terminate or end the execution of your program. Execution can be resumed at any time."

Changed from comment to answer

So it is instead of deleting stuff directly in your code/commenting parts of your code out?

For example, setting breakpoint at res.send(posts); in the node-inspector window, is equal to:

app.get('/blog', function(req, res){ 
    //res.send(posts);
});

Is that correctly understood?

Anthony c
Anthony c
20,907 Points

So they are used to do a process of elimination?