Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.