Cyclical indexing
let phrases = [
"I love you",
"a little",
"a lot",
"passionately",
"madly",
"not at all"
]
return phrases[(nbPetals - 1) % phrases.length];
}
The code (nbPetals - 1) % phrases.length is used to determine which phrase to retu...
1x55.hashnode.dev2 min read