filter

Solutions on MaxInterview for filter by the best coders in the world

showing results for - "filter"
Roberto
14 Feb 2020
1select *
2from   toys
3where  toy_name ='Sir Stripypants' OR colour ='blue'
4	   AND price = 6;
Louis
13 Oct 2017
1function isBigEnough(value) {
2  return value >= 10
3}
4
5let filtered = [12, 5, 8, 130, 44].filter(isBigEnough)
6// filtered is [12, 130, 44]
7
Gabriele
17 Feb 2019
1df_filtered = df[(df.Price > 500000) & (df.Rooms > 3)]df_filtered.head()
Paula
14 Feb 2019
1select toy_name
2from   toys
3where  toy_name like '%B%;
Serena
06 Aug 2019
1const array = [-3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]; 
2
3function isPrime(num) {
4  for (let i = 2; num > i; i++) {
5    if (num % i == 0) {
6      return false;
7    }
8  }
9  return num > 1;
10}
11
12console.log(array.filter(isPrime)); // [2, 3, 5, 7, 11, 13]
Pablo
16 Feb 2017
1select *
2from   toys
3where  colour in ('red','blue')
4	   AND price >= 6 AND price < 14.22;
Clara
07 Aug 2020
1select toy_name
2from   toys
3where colour <> 'GREEN' AND price <> 6
similar questions
queries leading to this page
filter