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.
Great stuff!
You're using a global var, and it keeps its value between tests. It's in the Troubleshooting guide I told you in my first post ;)
This comment is hidden because it contains spoiler information about the solution
You use
split
to separate the words, there is an array method to undo that, it's one of these: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array#instance_methods and you already used it in your code, that way, you don't add that space to the end or you could use another string method to get rid of it, your choice."test"
is a 4 letters word, it's going inside your first if, and you're adding a space to the final string.This comment is hidden because it contains spoiler information about the solution
Look harder at your first if.
Ive looked over the document you provided me, thanks for that. I still can't understand why my code isn't working. It's saying now ive left a space at the end of the returned string.
Oh well, thanks for trying to help.
Read this: https://docs.codewars.com/training/troubleshooting/ about your code's problem
And this about how to post your code here: https://docs.codewars.com/training/troubleshooting/#post-discourse
This comment is hidden because it contains spoiler information about the solution