Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Your Python solution will not work in JavaScript. Your problems are caused exactly by the thing which works in Python, but not in JS.
arr[-1]
works differently in JS and Python.With your updated code it is:
nbPetals % phrasess.length - 1
does not do what you think it does, but you need to take it from here.When you ask for help, please ask for help and not just post code. Refer to this documentation to debug your code and ask for help efficiently: https://docs.codewars.com/training/troubleshooting/
Don't post solutions in discourse and use the spoiler flag when you post code somewhere.
https://www.codewars.com/kata/52685f7382004e774f0001f7 is this your challenge? you can also try going to "view profile" > "Kata" > "Unfinished"