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.
It's trivial to pass the first two requirements by changing the property/object name, so they aren't enforced at all.
Well, instance methods should stay in the prototype because this is the best practice. Assigning them to the object every time creates new functions for every instance, and every instance needs to be modified if you need to change one of them.
You're asking us to refactor into a worse design. This is a bad idea.
I think
toyShop = new ToyShop()
is really misleading.Unlike mine, your solution is not a constructor. After your refactoring,
toyShop
is no longer an instance ofToyShop
.edit: Just to be more clear, I made this comment because not requiring
ToyShop
to remain a constructor decreases the difficulty of this kata significantly.Nice! Thanks, my attempts to fix the testing holes are not as slick as this solution
I'm going to add another test ;)
Tim!!! You rockstar :) All good
This is a hard one to test for. I cheated pretty hard. How's it going stujo?!
This comment is hidden because it contains spoiler information about the solution