Jump to content

Sort stability: Difference between revisions

(Added AppleScript.)
Line 407:
 
=={{header|JavaScript}}==
The ECMAScript 2019 standard defines Array.sort() as stable.
The ECMA standard does not specify what sorting algorithm to use, so it depends upon the implementation.
 
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"]]
9,655

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.