Finding a function in a large bundle to set a breakpoint takes time. If the function is reachable from the console, debug() sets the breakpoint for you.
debug(updateCart)
// now click the button that calls updateCart()
// DevTools pauses on the first line of the function
undebug(updateCart)
When the function is called, Chrome pauses inside it in the Sources panel, just as if you had set a breakpoint on its first line. From there you can inspect the arguments, step through and see who called it in the call stack. undebug() removes it again, or you can switch off all breakpoints in the Sources panel.
It works for methods too, like debug(cart.add), as long as you pass the actual function that will be called.
The limit is reach. The console can only see functions on the global scope or ones you can get to from there. A function hidden inside a module or a closure is not reachable by name. In that case I’d pause somewhere nearby first, or use a logpoint.
Like copy() and $0, debug() is a console utility and not part of JavaScript. It only exists while you type in the console. In your page code it is simply undefined, so keep it out of your source files.
Further reading: Chrome DevTools: Console Utilities API reference