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.
No matter how i try guys i will never can fix any of these questio nim trying guys i cant well .... there is othing wec an do ? ? can anyone understand me?
better to do CONST value for 10, i done so, but think then more
If the requirements state "10 or more," then I think it is better to translate that language directly to code (i.e., "foo >= 10") rather than to a logical but inferred equivalent.
However obvious the inference might seem to you, it might not be so obvious to the maintenance developer who needs to understand how your code manages to fulfill (or, if he is fixing a defect, how it fails to fulfill) the requirements.
An obvious exception is when performance is an issue--but, then, only when performance is an active, demonstrable issue. (In this case, there is no performance advantage either way.)
no, its clever and the best practices!!
Not an issue
I've added a test case where
n==m
to both the Javascript and CoffeeScript tests. I also edited the description to clarify that 0 is the expected result and added an example to show this.The only advantage is less code as you said.
In most cases, using if/else is recommanded for readability.
What is the advantage to using this ternary/conditional operator vs say an if/else aside from less code? Is there a practical advantage or more edge case?
Not an issue
This is the real winner for clever solutions here. Not best practices, but certainly neat!
8 kyu has the following for examples though:
This seems to fit, at least to me.
Some random tests wouldn't go amiss. If the trailing sorted string is intentionally there as a red herring, cool, otherwise it doesn't really add anythign to the kata.
I googled "javascript pass arguments to another function" can got the solution. Google-Fu is 90% of code skill.
function isValidIP(str) {
return null;
}
This code passes the first nine tests in javascript. Further, this seems like a basic regex task, something that's suitable for 6th or even 7th kyu.
This kata has some serious flaws.
I agree. In Javascript it's a trivial regex one liner, and there's plenty of regex kata at 6th kyu.
Loading more items...