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 135 views
1 answer 148 views
1 answer 168 views
1 answer 176 views
1 answer 120 views
...