
Imagine you have to debug an issue with a button click. You have no idea where in the source code lies the handler for the button. Instead of digging through the source code, use the getEventListeners method as displayed above to get the reference to the click handler of the button and pass that function reference to the debug method. Then, if you click the button, devtools will pause the execution on the first line of the click handler.