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 a very interesting way to use the concept of an object in JavaScript!
So cool bro
No, it actually calls all 4 operations, due to the fact that the object initialization has to resolve it's properties during runtime
so by calling cases[operation], you're just returning 1 of 4 already calculated operations
impressive
Very clever
yeah
Impressive)))))))))
i saw some folks saying this runs all 4 operations but that isnt true right? the key [operation] is defining the condition for the code block within cases resulting in only the code matching the condition being executed? Essentially replacing switch(operation) if i understand it correctly.
Interesting way.
I was doing 'case' and it was appearing an error curious why this was happening but when puttting 'cases' it appeared correct?
Yeah; in fact, this particular approach relies on that.
it will change the input array :)
Clever, great!
Object Literal?
Edit: Oh wait, it is actually operating the other 3 as well, even if they are not selected? XD JS is weird.
Loading more items...