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.
I agree on this - I had originally put the condition for length in the spin word function as well for the sake of prettier code in the main function. The lack of seperation of duties ended up bugging me too much so I pulled the condition back into the return of the main function. This makes the spinSingleWord function more useful in other functions as it is as you have mentioned agnostic to the logic it just does the job. If you were add in another function to futher abstract the logic, I would probably have it take the length after which to spin the word as an argument.
Object.keys(needs).map() returns array, so then it's destructured to feed values into Math.min()