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.
Too bad javascript doesn't have tail call optimization...
+1 for solution using tail recursion
This is awesome.
I would say be careful about using
getOwnPropertyNames
. If someone creates a non-enumerable property on an object, chances are that they're explicitly looking to hide that property from enumerations, (i.e. most of the methods attached toObject.prototype
). When creating a method that's supposed to return an object's keys and values, I've always found it more effective to honour the integrity of the object being passed in by only looking at enumerable properties. Otherwise the author of the object wouldn't have gone out of their way to explicit make that property non-enumerable. Just a thought!