// Is there a better way to do this?
function resetAscend(confirm = true) {
var work = true;
if (confirm) {
if (!window.confirm("Are you sure?")) {
work = false;
}
}
if (work) {
alert("A");
} else {
alert("B");
}
}
// I mean, if "confirm" is false I don't want to make a confirm popup.