1select *
2from toys
3where toy_name ='Sir Stripypants' OR colour ='blue'
4 AND price = 6;
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
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]
1select *
2from toys
3where colour in ('red','blue')
4 AND price >= 6 AND price < 14.22;