Created
July 13, 2017 18:21
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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