-
Notifications
You must be signed in to change notification settings - Fork 0
/
24.ts
45 lines (36 loc) · 1.46 KB
/
24.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
let arr1=["red", "blue", "green", "white", "pink"];
let arr2=["goat", "camel", "deer", "elephant", "lion"];
let string1="Dawood";
let string2="dawood";
let num1 = 20;
let num2 = 10;
console.log("\nTests for equality and inequality with strings")
console.log(string1 === string2);
console.log(string1 !== string2);
console.log("\nTests using lower case function")
console.log(string1 === string2);
console.log(string1.toLowerCase() === string2);
console.log("\nNumerical tests involving equality and inequality")
console.log(num1 === num2);
console.log(num1 !== num2);
console.log(num1 > num2);
console.log(num1 < num2);
console.log(num1 >= num2);
console.log(num1 <= num2);
console.log("\nTests using && - || operators");
console.log(num1 === num2 || num1 !== num2);
console.log(num1 !== num2 && num1 === num2);
console.log(num1 > num2 && num1 < num2);
console.log(num1 < num2 || num1 > num2);
console.log(num1 >= num2 && num1 <= num2);
console.log(num1 <= num2 || num1 >= num2);
console.log((num1 >= num2 && num1 <= num2) && (num1 === num2 || num1 !== num2));
console.log((num1 <= num2 || num1 >= num2) || (num1 !== num2 && num1 === num2));
console.log("\nTest whether an item is in/notin a array");
console.log(arr1.includes("pink"));
console.log(arr1.includes("orange"));
console.log(!arr1.includes("purple"));
console.log("\nTest whether an item is in/notin a array");
console.log(arr2.includes("buffalo"));
console.log(arr2.includes("elephant"));
console.log(!arr2.includes("giraffe"));