How to convert a boolean value to yes or no in Node.js

1 Answer

0 votes
const n = 10;

let s = n > 8;

s = s === true ? 'Yes' : 'No';

console.log(s);

  
  
  
  
/*
run:

Yes
  
*/

 



answered May 15, 2022 by avibootz

Related questions

1 answer 124 views
1 answer 142 views
1 answer 161 views
1 answer 167 views
1 answer 112 views
...