The sort method behaves different on different browsers

It isn’t really being sensitive, your code is technically wrong for both callbacks. AFAIK, for a stable sort in Chrome, the callback has to return -1, 0 or 1 (or -n, ±0, +n which would be normalised to -1, 0 and 1 anyway). The fact it happens to work in FF is just a thing at this current point in time; it could change tomorrow. Chrome had an open issue for ages to fix sort so that is was stable, so they did fairly recently (I think September? They’re using Timsort anyway if you’re super interested in sorting algorithms or whatever)

I’d advise just returning the correct thing from the sort function though: it’s not supposed to be a boolean and trying to rely on browsers working strangely isn’t a good idea