Is there a way to update the value of a variable? I attempted the method below, but unfortunately, it was unsuccessful:
function UpdateData() {
var newValue = 0;
$.ajax({
url: "/api/updates",
type: "POST",
success: function (response) {
newValue = response;
}
}
});
return newValue;
};