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.
objects in js are dictionaries, and functions are objects theirselves, so you can call any function that is part of an object with a dictionary key.
The function here is just for grouping and doesn't add any special method classes that do work. You can easily copy the function code and put it exactly where the function call is and it will work exaclty the same.
Not as true to the specs as it could to be, and not as efficient as it should be, but I wouldn't call it 'cheating'
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Cheating but cool, didn't know this is a thing. Is there a term for this principle - running strings as code?
In Javascript functions call as objects, right? (you can create a function f and check with "f instanceof Object"), so it's cheating :-/
The flexible use of the for-loop is inspiring!
I like the clarity of the code a lot, mine is far more chaotic :-P
Way too easy... even for me xD!
That's how recursion works, check your code here: http://pythontutor.com/javascript.html#mode=edit
Thanks for replying! I figured it out now, I have to add 'return' in front of the last line, too (before calling the function again) - which seems a bit odd to me :-P
Have you tried to run your solution in your local IDE and see how it works?
This comment is hidden because it contains spoiler information about the solution