Skip to content

Instantly share code, notes, and snippets.

@soichisumi
Created August 20, 2018 09:40
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 soichisumi/f97f0b6c7f9d2864dd18700f6431c572 to your computer and use it in GitHub Desktop.
Save soichisumi/f97f0b6c7f9d2864dd18700f6431c572 to your computer and use it in GitHub Desktop.
let humans = new Array()
humans.push({
name: "yoyo",
age: 26
})
humans.push({
name: "test",
age: 55
})
humans.push({
name: "nama",
age: 12
})
humans.push({
name: "old",
age: 77
})
console.log(humans)
humans.sort((a, b)=> {
return a.age - b.age;
})
console.log(humans)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment