Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ethanstenis/1e23749cfce9832f25296d1d9dfcd6a0 to your computer and use it in GitHub Desktop.
Save ethanstenis/1e23749cfce9832f25296d1d9dfcd6a0 to your computer and use it in GitHub Desktop.
This is the solution to Codewars' I love you, a little, a lot, passionately, madly... not at all KATA
function howMuchILoveYou(nbPetals) {
if(nbPetals % 6 === 1) {
return 'I love you';
} else if (nbPetals % 6 === 2) {
return 'a little'
} else if (nbPetals % 6 === 3) {
return 'a lot';
} else if (nbPetals % 6 === 4) {
return 'passionately';
} else if (nbPetals % 6 === 5) {
return 'madly';
} else {
return 'not at all';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment