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.
If the recipe is blank it is logically perfectly correct to return Infinity (or whatever, in fact).
We can add this at the first line: if (Object.keys(recipe).length === 0) return 0;
It will save us from empty recipe.
In the rest this solution seems to be the best practice.
+1
I was thinking the same thing, I had never thought of using this syntax in functions arguments, useful
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution