javascript nan code example
Example 1: how to check when a number varibal = nan in ts
if (isNaN(number)) {
number = 0;
}
Example 2: nan javascript
// NaN: Not a Number in javascript
console.log(parseInt('1.23')); // 1.23
console.log(parseInt('something')); // NaN
Example 3: javascript nan
NaN = Not a number.
Example 4: nan in js
var val = Number.NaN;
Example 5: check if var is NaN
let b=1
let n=readline()
if(isNaN(b)){
console.log("You typed 0!")
}else{
console.log("You did not type 0!")
}