Dark Mode
Enable Console
boolToWord(bool)
/*
Returns value of a boolean using a string, like 'Yes' or 'No'
*/
boolToWord(true);
// 'Yes'
boolToWord(false);
// 'No'
Solution by - Need4Swede
function boolToWord(bool){
// If bool is true, return 'Yes', else return 'No'
return bool ? 'Yes' : 'No';
}
Try it yourself - Codewars Source