Starting with ECMAScript 2019, the Array method
.sort() is guaranteed to be stable. What does that mean (as proposed by Mathias Bynens)?
It means that if elements that are considered equal by sorting (not necessarily in any other way!) then sorting does not change the order of those elements. For example:
Two objects have the same
'b'. Their order will always be preserved by
.sort(). One benefit is that a unit test where stability matters, now works the same across engines.