Jak sprawdzić, kiedy warunek liczby = nan w TS
if (isNaN(number)) {
number = 0;
}
Mr Big Code
if (isNaN(number)) {
number = 0;
}
let value = 0 / 0; // undefined
if (isNaN(value)) value = 0;
let b=1
let n=readline()
if(isNaN(b)){
console.log("You typed 0!")
}else{
console.log("You did not type 0!")
}
// NaN: Not a Number in javascript
console.log(parseInt('1.23')); // 1.23
console.log(parseInt('something')); // NaN
NaN = Not a Number
const bird = "crow"
const colour = "black"
const total = bird + colour
console.log(total)
//NaN = Not a number