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.
You're just smart. I take my hat off to you.
I feel so, so stupid.
The left side of the comparison determines if the variable is NOT an "existing"
true
or an "integer""not a decimal
", the result isundefined
If the left of the comparison fails, then we move to the right comparison
If the integer is odd then return false, else return true.
Because this is kumite. Here it's about showing off skills related to the knowledge of tricks to reduce the length of the code as much as possible, I think. Of course, in "normal" code readability is very important.
Why you dont return simple undefined instead od {}.a ?
I mean:
isEven=n=> n%1==0 ? !(n%2) : undefined
and this is more readability. When you put some whitespace beetween
0
Well done! I didn't know the trick {}.a for undefined...
Well done! Nice and clean.
This comment is hidden because it contains spoiler information about the solution
Indeed
glad u haven't see my solution
it's an ancient JediScript mind-trick
What the hell
Even simpler than I thought :)