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.
It doesn't work for string that has more than 1 dash/underscore group together.
i.e. toCamelCase('the__stealth-warrior')
Smart! But it only converts the first character in each word to uppercase. Shouldn't it also convert the rest of the characters in each word to lowercase?
Nah this dojo level is insanse.
space delimeter missing
It will not work in cases like
toCamelCase("-the-stealth-warrior") === TheStealthWarrior // incorrect
I think my solution is more understandable, Just kidding
I like it but your solution would not work for cases like: oguNbanjo--_temiloluwa
I agree with you. I think that it is just a good practice for independent function.
The description does not specify what the expected output for a missing input is so you don't have to account for this case. If it would still be tested then this would be worth a kata issue but
undefined
/null
inputs just don't make sense for this kata.I think you also need to add the check for undefined value at the start of function.
if (str === undefined){
return '';
}
I completed mine using regex but this level of swordsmanship is inspiring.
This sent me to learn more about regular expressions. Thanks for the learning opportunity!
im no expert on regexp. im no expert on js neither. but 2 lines of comments can solve this issue.
i think this is an excellent solution and one that i aim to write one day.
i think that the combination of replace with the callback is something that shows knowledge...
well its my opinion after all!
I think you solution may be able to benifit from refractoring, but you should be proud of all 40 lines! Anyone can learn and apply regEx with relitive ease. But to code this without regEx is much more of a challenge! Good work Todd!
if i am i right the regex matches the '-' or the _ along with the next character (that is what the \w is for) and also the reason for the charAt(1) to select the character at position 1 in this case the \w character and capitalize it.
i am new here so i hope i am not loosing honor replying to this comment. Dont really know how things work here yet
Loading more items...