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 would be better to replace
false : true
with=== 0
;Similar to mine but yours is way cleaner, wish I had thought of it!
Yeah I'm still pretty new to Codewars and programming in general, so I was thinking that modifying objects in place here wouldn't really matter, since I figured the string wasn't going to be used again after I ran the code, so I didn't realize it would affect the expected strings in the test cases. I spent so much time trying to figure out what was going wrong! Thanks for your help, I will definitely be more careful from now on!
We mixed our posts. If I correctly understand you modified the input string in place? Wow, bad practice:-))
Oh wow, I didn't even think about that haha! That fixed it right away. Thanks a lot and sorry for reporting an issue!
Example tests: you have
testing(decode($data2Sol), $data2)
.In the example tests you can see yourself that decoding
$data2Sol
gives exactly$data2
, the\v
are not kept and what you get is correct.The expected you had had doesn't correspond to the given solution of the example tests!
I don't understand what happened:-( I tried a few solutions already passed, I printed the results and everything was correct.
Edit: your solution passed so why an issue?
This comment is hidden because it contains spoiler information about the solution
Thanks!
Wow, floating point arithmetic in JS messed me up on this one! Thanks for the challenge, learned a lot!
Try logging your stack to the console. Your code has a bug.
Rewrote so that methods were defined on prototype