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 was an issue 7 years ago, other people reported similar problems - server-side tests (I guess node.js) were handling the copying/cloning not the same way chrome was doing it.
The tests may be working fine, but they work (at least worked) differently in different interpretators.
It's not issue with my code. I've reported that my code produces different outputs when it's run in browser and on your server.
Closing it like this 7 years later is just rude.
Good thing I'm not investing my time into this website anymore.
Issue with your code is not an issue, JS's tests work fine
In JS you copy the outer array then each element (inner array):
Same problem, I used thingy called "deep copy". It copies from another copy or something like that. In Ruby the syntax is name1 = Marshal.load(Marshal.dump(name2)). Pretty sure there is something like that in JavaScript.
I have the same problem,how to solve it?
Well, there is the test that I mentioned in my original comment. The result I'm getting in my chrome is different from the result codewars shows on 'Run Tests' command.
Would you care to check a demo I set up at external website?
I think good ol' console.log() can help; you with it.
And making test increasingly difficult, i.e. start with a trivial case then add "more complex test" until you get to the point you want
I've created simple solution using recursion in JavaScript.
This particular test case: 'A pretty simple map (2x2) - Should return the only moves necessary' produces different results when my solution is executed in browser (manually by me) and when it's run server-side ('Run Tests') mode.
I've read comments here and rewrote solution so it doesn't update the map (though it was working locally even with map being changed while solving).
However, it still produces different results.
My guess is that server side Javascript interpreter here is dealing with recursion in a different way.
Question: how to debug a problem like this?