How to use ternary operator in TypeScript

1 Answer

0 votes
let x: number = 43, y = 98;

x > y? console.log('x > y'): console.log('x <= y')
  
   
   
/*
   
run:
   
"x <= y" 
  
*/

 



answered Oct 24, 2021 by avibootz
...