Skip to content

Instantly share code, notes, and snippets.

@MauricioRobayo
Last active August 23, 2021 02:29
Show Gist options
  • Select an option

  • Save MauricioRobayo/bf9ae0950161e76729f0255aa236f49a to your computer and use it in GitHub Desktop.

Select an option

Save MauricioRobayo/bf9ae0950161e76729f0255aa236f49a to your computer and use it in GitHub Desktop.
#gogofast
The sort() method sorts the elements of an array in place and returns the sorted array. The default sort order is ascending, built upon converting the elements into strings, then comparing their sequences of UTF-16 code units values.
items.sort((a, b) => a.localeCompare(b));
sort() and reverse() perform in place operations, modifying the original array.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment