How to check if number is not greater than 0 in TypeScript

1 Answer

0 votes
const num = -81;

if (!(num > 0)) {
  	console.log('number is not greater than 0');
} else {
  	console.log('number is greater than 0');
}


  
  
  
/*
run:
  
"number is not greater than 0" 
  
*/

 



answered May 26, 2022 by avibootz
...