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.
My code is correct, but it doesn't work properly in the random test!
Why don't the creator of this exercise take responsibility for the sample tests?
shouldn’t this kata be tagged with regex?
I am well aware that as a developer you are supposed to look for ways and answersbut come on my guy... not tests for Javascript? anyways just copy and paste this tests and youll be all good...
BTW i got the tests from a guy further down the comment section.
Test.assertEquals(toUnderscore("Test7Welt"), "test7_welt", "Failed Test7Welt")
Test.assertEquals(toUnderscore("TestWelt"), "test_welt", "Failed TestWelt")
Test.assertEquals(toUnderscore("test7welt"), "test7welt", "Failed test7welt")
Test.assertEquals(toUnderscore("helloWelt"), "hello_welt", "Failed helloWelt")
Test.assertEquals(toUnderscore(1), "1", "Failed number")
Test.assertEquals(toUnderscore(null), "null", "Failed null")
Nice kata, but is it really 5 kyu?
It's Codewars, you can't those ratings too seriously. People just like to see short one liners regardless of readability and efficiency.
Sometimes you can learn interesting tricks from them too.
It is definitely not recommended. It looks clever but that's it. When you work with other developer, readability is more important. I just think it is a cool way to solve problem. But it could also mean code efficiency, eg your code use less variable etc. I could be wrong.
I am seeing 👀 many people upvoting 🗳️ the single-line solutions.
Whereas It not a recommended practice where there are many operations are going on.
Because it compromises the code readability.
What do other people think ❓
single line solution should be supported and recommended or deserve downvote ❓
Approved
Arigato, sensei.
"onone"
is not the input there, it's your incorrect returned value. The input was"OnOne"
.There is no mention of "onone" should equal to "on_one" in the description or examples, and the description says "accepts Pascal Case as input" how is "onone" a Pascal Case?
ok, this one was fun. love my string manipulation :)
Your code is wrong, not a kata issue. Print the input, figure out why.
Loading more items...