There's a faster version of egghead. Click here to try it.
Become a member
to unlock all features

Create an egghead account to access 5000+ tutorials and resources from expert developers.

Create account

    Explore ES2019 stable array sorting by example


    Before ES2019, array sorting in Javascript was not guaranteed to be stable. In this lesson, we'll learn what stable sorting is by seeing an example of unstable sorting. We'll use nvm to switch between an older version of Node and a newer version and compare how each version deals with sorting. Lastly, we'll mimic stable sorting by adding indexes to our array elements and comparing the indexes during sort.

    You can find installation instructions for nvm here: Stable sorting was adding to v8 v7.0 (Chrome 70 and Node 11), as noted here: