Your usage of method confirm is wrong, you can read about that method here
You can used code like this:
if (confirm('question')){
console.log('yes')
}
else{
console.log('no')
}
EDIT Using bootbox use this code
bootbox.confirm("Are you sure?", function(result) {
Example.show("Confirm result: "+result);
});