Woah that's cool. I didn't know argument could be asigned to a function and the function would be performed on it.
Thats the way a bodies suppose to be.
oooohh, now i understand. thank you!
i don't understand, how does this work?
This comment is hidden because it contains spoiler information about the solution
What a nice explanation! Many thanks, brother!
Ruby 3.0 should be enabled.
Yeah, just as the original and all the other translations don't have random tests.
I will check if I can adds something.
No random tests.
Why not simply put everything to lowercase and deal with the characters after the first one? Looks like a lot of trouble and memory usage (2 arrays created)
return str.charAt(0) + str.substring(1).toLowerCase.replace(/-_/g, (_, c) => c.toUpperCase());
beautiful piece of code. thanks for explaining. got to learn regex.
I had exactly the same thing. And then, I solved the kata ^^