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 exchange :D
description of this kata clearly says: "All values will be positive integers or floats." abs is not required.
but it's handy for assignment
the return statement isn't required.
I've thought the same plenty of times on this site. What you implemented was the canonical swap solution. There are plenty of other ways to swap variables. E.g. XOR swap for integers.
Argh, I should have thought of that!
This comment is hidden because it contains spoiler information about the solution
Well, if there is ever an array passed to the function as the first argument, and the array has a reverse method, then it should work.
Of course you might not know about the arguments object. I don't name any arguments for the function, but there is an array-like object called arguments that appears in every function call context. It isn't technically an array (you can't use array methods without converting it to one), but you can reference it like arguments[0], arguments[1], arguments[n], arguments.length.
This comment is hidden because it contains spoiler information about the solution
you can only call reverse on an array, arguments[0] is not I get this:
arguments[0].reverse is not a function
do you mean args[0]?
Cool. Didn't know this. Is it a recommended way of testing keys in objects? or items in arrays? Looks short and sweet. Are there known pitfalls?
This comment is hidden because it contains spoiler information about the solution
Hmm. So it's kinda of a for in loop thingy?
This comment is hidden because it contains spoiler information about the solution
nice man.
Loading more items...