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.
in older javascript versions,
Array.prototype.sort()
was not guaranteed to be stable.Yes, it's a Node specific issue, and not really a kata bug.
You assume that elements which are not meant to be moved will stay on their original relative positions, which is not the case with
sort
in Node 8.sort
can, in case of Node 8, reorder elements in any way as long as the final ordering satisfies requirements of your comparer. With input of[2,0,7]
it's perfectly fine to get the sorted result of[7,2,0]
.This comment is hidden because it contains spoiler information about the solution