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.
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 ;)
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.Look harder at your first if.
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