Answers for "replace nan by zero js"

0

javascript change nan to 0

a = a || 0 //if "a" is false (NaN included), will return 0
Posted by: Guest on May-23-2021
0

how to replace nan with a value in js

function getNum(val) {
   val = +val || 0
   return val;
}
Posted by: Guest on December-21-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language