title: Change NaN to 0 in Javascript
body: <p>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?</p>
  
  <p>Here is my code that return result:</p>
  
  <pre><code> $(".average").click(function () {
   var result = average();
   $("#myModal .modal-body h2").text(result);
   $("#myModal").modal();
   });
  </code></pre>