Google "debug javascript" and you'll find some articles, but basically add the debugger statement
debugger;
$('.edit-mode').hide();
$('.edit-user, .cancel-user').on('click', function () {
var tr = $(this).parents('tr:first');
tr.find('.edit-mode, .display-mode').toggle();
});
Make sure you have the browser's dev tools open (usually f12) and when you load the page it will break on the debugger line and the dev tools will let you go line by line as well as inspect variables etc. Exactly how this works differs from browser to browser so google for more specific info.