Hi Guys,
I'm pretty new to JS but have a few kata's under my belt now. I have an idea how to approach this but if anyone knows a resource or link that might help, please point me in the right direction
Cheers!
Simple, remove the spaces from the string, then return the resultant string.
Your function's code has no return inside so your function is returning undefined. 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.
Awful ahaha!
This comment is hidden because it contains spoiler information about the solution
Hi Guys,
I'm pretty new to JS but have a few kata's under my belt now. I have an idea how to approach this but if anyone knows a resource or link that might help, please point me in the right direction
Cheers!
After seeing how easily this could be acheived with 6 lines of code.... i am still happy with my attempt
This was embarrassing compared to others. But I am a N00b
Well i appreciate you taking the time
I've been coding about a week and wanted to solidify my learning. A friend suggested here
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.
Thanks, I appreaciate the feedback and have revised the code
May be a stupid question but what do you mean by 'your function should return a string'?
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.
This comment is hidden because it contains spoiler information about the solution