Sort stability: Difference between revisions
→{{header|JavaScript}}
(Added AppleScript.) |
|||
Line 407:
=={{header|JavaScript}}==
The ECMAScript 2019 standard defines Array.sort() as stable.
At the time of writing this is already implemented in in Node.js and in the JS interpreters of all major browsers, including Microsoft Edge, but not in the older Internet Explorer. In earlier interpreters, sort stability depends on particular implementations.
<lang javascript>ary = [["UK", "London"], ["US", "New York"], ["US", "Birmingham"], ["UK", "Birmingham"]]
|