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.
This is brilliant.
OOKKKEYY
Awesome. clean code
Clean and clear code. Love it
this is great because it also takes care of only having to check for one "r" while still returning the name in its original format:)
clean
Wow this is nice, love it!
This is so so clever... clapping my hands.
awesome
so clever
Thanks 9 years later
In the instructions of the problems. There was a sentence : "Names given are always valid strings."
ah + maze'n !!!
Difficult to decide whether you'd use the ternary for the smallest code or use an if statement to make it more readable for someone else. I guess you'd go with the ternary because a dev should be able to recognise it.
if you mean the name[0], let me explain.
The [0] is called index and when you put it after a string/array, you get the first, second, nth elements respectfully. in this case, name[0] means the first element (letter) in the string.
Remember that in coding we start counting from 0, that's why the first element has the 0 index, the second one has 1 and so on.
Hope this helps, I tried to explain this as easy as possible. However, I suggest you to look for this on the Web.
Loading more items...