Kata of the Day #5

Convert boolean values to strings 'Yes' or 'No'

kata
kata
kata
kata
kata
kata
kata
kata
kata
kata
kata
kata
kata
kata
kata
kata
kata
kata
kata
kata
Kata of the Day #5

Complete the method that takes a boolean value and return a "Yes" string for true, or a "No" string for false.

TypeScript


export const boolToWord = (bool: boolean): string => {
  return bool ? "Yes" : "No";
};

Go


func BoolToWord(word bool) string {
  if word {
    return "Yes"
  } else {
    return "No"
  }
}

Go to Kata
ByCesar Kohl

Need some help?

Want us to give you some help with your business? No problem, here's a video on who we can help, and how, along with our calendar so you can book in a call to discuss us working together.

Let's see
budget
budget
budget
budget
budget
budget
budget
budget
budget
budget

Subscribe to our newsletter

subscribe
subscribe
subscribe
subscribe
subscribe
subscribe
subscribe
subscribe
subscribe
subscribe