1var words = ['spray', 'limit', 'elite', 'exuberant', 'destruction', 'present'];
2
3const result = words.filter(word => word.length > 6);
4
5console.log(result);
1var id = 2;
2var list = [{
3 Id: 1,
4 Name: 'a'
5}, {
6 Id: 2,
7 Name: 'b'
8}, {
9 Id: 3,
10 Name: 'c'
11}];
12var lists = list.filter(x => {
13 return x.Id != id;
14})
15console.log(lists);
16
1let bigCities = cities.filter(city => city.population > 3000000);
2console.log(bigCities);Code language: JavaScript (javascript)