How to check if floating point is NaN in TypeScript

3 Answers

0 votes
const value: any = NaN;
 
console.log(Number.isNaN(value)); 
  
  
 
/*
run:
 
true
 
*/

 



answered Aug 3, 2025 by avibootz
0 votes
const value: any = NaN;
 
console.log(isNaN(value)); 
  
  
 
/*
run:
 
true
 
*/
 

 



answered Aug 3, 2025 by avibootz
0 votes
const value: any = NaN;
 
console.log(value !== value); 
  
  
 
/*
run:
 
true
 
*/
 

 



answered Aug 3, 2025 by avibootz
...