1let cities = [
2 {name: 'Los Angeles', population: 3792621},
3 {name: 'New York', population: 8175133},
4 {name: 'Chicago', population: 2695598},
5 {name: 'Houston', population: 2099451},
6 {name: 'Philadelphia', population: 1526006}
7];
8
9let bigCities = cities.filter(function (e) { // filter function
10 return e.population > 3000000;
11});
12
13//Output:
14[
15 { name: 'Los Angeles', population: 3792621 },
16 { name: 'New York', population: 8175133 }
17]
1const object = { a: 5, b: 6, c: 7 };const subset = (({ a, c }) => ({ a, c }))(object);console.log(subset); // { a: 5, c: 7 }