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.
Thanks for the input. I borrowed the idea from Elixir's standard library:
http://elixir-lang.org/docs/stable/elixir/Integer.html#digits/2
http://elixir-lang.org/docs/stable/elixir/Integer.html#undigits/2
This is by far the best solution I've seen. One thing that I'd like to point out, is that this method won't preserve the order of the digits going into the array. IF for some reason the order is important to you, you can use
unshift()
rather thanpush()
.Beautiful! Thank you!!
This comment is hidden because it contains spoiler information about the solution
As a general best practice when extending base objects, you should protect against the existence of your new function.. For example do something like:
Also, it would be nice to have some comments in your
digits()
method that explains what it is doing. Other than that your code looks really good and reads well.Thank you sir.
Thank you :)
This comment is hidden because it contains spoiler information about the solution