Skip to content

Instantly share code, notes, and snippets.

View onildoaguiar's full-sized avatar
:octocat:
building...

Onildo Aguiar onildoaguiar

:octocat:
building...
View GitHub Profile
@onildoaguiar
onildoaguiar / ascendingSort.js
Created November 2, 2018 14:33 — forked from seckBalla/ascendingSort.js
Example of functional sorting an object array by name and age
const persons = [
{ 'name':'Luke', 'age':10},
{ 'name':'Leia', 'age':10},
{ 'name':'Vader', 'age':40}
];
const ascending = x => y => x > y;
const ageSort = (x, y) => ascending(x.age)(y.age);