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 comment is hidden because it contains spoiler information about the solution
Fixed. I removed some pointless and broken stuff in Preloaded.
This comment is hidden because it contains spoiler information about the solution
Hey yeah, I should get rid of that test. But I cant think of an idea of how to restrict users from declaring variables outside of the function. Hrm.
Wow, you are really serious about helping other people. Your explaination should get more voted. Thank you very much, I have learned something new from it. Keep doing the good work, and have a nice day. :)
That probably should be 'lowerCase' not 'loverCase'
Hi Matorzinho!
Sure thing:
You can think of the comma operator as a way to compose multiple expressions into a single expression chain.
The expressions are evaluated in order, with each of their results discarded. The final expression however (the last one in the chain) returns its result as the result of the combined expression.
For Example:
Could be re-written with the comma operator as:
This can be useful if you need to use multiple expressions in a place that can only take a single expression. However, I haven't seen many uses that wouldn't be improved by being more explicit so I try to reserve its use for code golf.
Because this function now contains a single statement, it could be further-reduced.
Also worth noting that the comma has the lowest operator precedence, so consider parentheses.
Hope this helps!
Hi colby,
I want to know the same thing that Viktor asked but I didn't understand your answer, would you mind rephrasing it?
I always see your solutions and they are a great motivation for me, thanks!
The comma operator evaluates each of the statements, left to right, regardless of their return, and returns the result of the final statement.