How to check if number is NaN in Node.js

1 Answer

0 votes
const num = 981 / 'node.js';

console.log(num); 

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

 



answered Jun 29, 2022 by avibootz

Related questions

...