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.
Yeah, you only ever need the last two cache entries.
That only works if the order of the keys maintains constant. This is not only not guaranteed within JavaScript, but has already been proven to cause issues earlier.
It might be a fluke that the solution you see passed when it was written. It's possible that an updated Node engine is more strict. I specifically expect an empty object with no keys if the input string is empty.
Your code fails when dealing with an empty query string. Please read the output when submitting the code.
I don't know why it's failing on the example tests for me, but that used to work, and I haven't changed anything. I think it's a Codewars bug.
Thanks. Changed it :)