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.
This comment is hidden because it contains spoiler information about the solution
Your function's code has no
return
inside so your function is returningundefined
.console.log
can be used to debug, but for almost all katas in Codewars, your function should return a value.If you're completely new to programming I suggest you try doing some free online course/s first because although there are beginner katas here, most assume you have a certain knowledge and won't explain the very basics.
Not a kata issue, it's a problem with your code, use Question label for cases like this.
Don't use global vars (they keep their values between tests), and your function should return a string, don't write code outside your function, it won't run when your function is called.