Skip to content

Instantly share code, notes, and snippets.

@mannuelf
Created June 4, 2022 05:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mannuelf/ea98f3b3936a9ed270f7b71203ce6389 to your computer and use it in GitHub Desktop.
Save mannuelf/ea98f3b3936a9ed270f7b71203ce6389 to your computer and use it in GitHub Desktop.
const numbers = [
[10, 11],
[90, 8],
[20, 2],
[80, 3],
[180, -22],
[30, -92],
];
const sorted = _.sortBy(numbers, (row) => row[1]);
const mapped = _.map(sorted, row => row[1]);
_.chain(numbers)
.sortBy(row => row[1])
.map(row => row[1])
.value()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment