Skip to content

Instantly share code, notes, and snippets.

@rxluz
Last active January 20, 2019 06:49
Show Gist options
  • Save rxluz/5d442745f326979c194d8b3e7da5e03b to your computer and use it in GitHub Desktop.
Save rxluz/5d442745f326979c194d8b3e7da5e03b to your computer and use it in GitHub Desktop.
Big O in JS: The basic that you need to know, see more at: https://medium.com/p/a5abb45570fa
const people = [
{ name: 'lucy', age: 13},
{ name: 'aline', age: 13},
{ name: 'john', age: 35},
{ name: 'peter', age: 21},
{ name: 'james', age: 45},
{ name: 'marcela', age: 17},
];
const getGreaterThan18 = () => people.filter(person => person.age > 18);
//or using destructuring
const getGreaterThan18_2 = () => people.filter(({ age }) => age > 18);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment