How to check if number is NaN in TypeScript

1 Answer

0 votes
const num = 17 / 'typescript';

console.log(num); 

console.log(Number.isNaN(num) ? "yes" : "no");
  
  
  
  
/*
run:
  
NaN
"yes"
  
*/

 



answered Jun 29, 2022 by avibootz

Related questions

1 answer 116 views
1 answer 99 views
3 answers 208 views
1 answer 100 views
100 views asked Jun 29, 2022 by avibootz
...