I have a code that return to me result of javascript average function in bootstrap modal. But when one of inputs are blank, he return NaN . How i can change NaN to 0?
Here is my code that return result:
$(".average").click(function () {
var result = average();
$("#myModal .modal-body h2").text(result);
$("#myModal").modal();
});