|
| 1 | +//1. |
1 | 2 | let englishGreeting = "Hello, World!"
|
2 | 3 | console.log(englishGreeting);
|
3 | 4 | let kurdishGreeting = "Silav, Cihan!"
|
4 | 5 | console.log(kurdishGreeting);
|
5 | 6 | let dutchGreeting = "Hoi, Wereld!"
|
6 | 7 | console.log(dutchGreeting);
|
7 | 8 |
|
| 9 | +//2. |
8 | 10 | let me = "I'm awesome!"
|
9 | 11 | console.log(me);
|
10 | 12 |
|
| 13 | +//3.1 |
11 | 14 | let x;
|
12 |
| -console.log("I think the value of x is a number"); |
13 |
| -console.log("The value of x is 6"); |
| 15 | + |
| 16 | +//3.2 |
| 17 | +console.log("I think the value of x will be: undefined"); |
| 18 | + |
| 19 | +//3.3 |
| 20 | +console.log(x); |
| 21 | + |
| 22 | +//3.4 |
14 | 23 | let x = 6;
|
15 |
| -console.log("I think the value of x is 6"); |
| 24 | + |
| 25 | +//3.5 |
| 26 | +console.log("the value of x is: 6"); |
| 27 | + |
| 28 | +//3.6 |
16 | 29 | console.log(x);
|
17 | 30 |
|
| 31 | +//4.1 |
18 | 32 | let y ="Sivan";
|
| 33 | + |
| 34 | +//4.2 |
19 | 35 | console.log("I think the value of y is a name");
|
| 36 | + |
| 37 | +//4.3 |
20 | 38 | console.log(y);
|
| 39 | + |
| 40 | +//4.4 |
21 | 41 | const y = "Hassam";
|
22 |
| -console.log("There will be an error because now I have |
23 |
| - the same variable with different values."); |
| 42 | + |
| 43 | +//4.5 |
| 44 | +console.log("There will be an error because now I have the same variable with different values."); |
| 45 | + |
| 46 | +//4.6 |
24 | 47 | console.log(y);
|
25 | 48 |
|
| 49 | +//5. |
26 | 50 | const z = 7.25;
|
| 51 | + |
| 52 | +//5.1 |
27 | 53 | console.log(z);
|
| 54 | + |
| 55 | +//5.2 |
28 | 56 | const a = z;
|
| 57 | + |
| 58 | +//5.3 |
29 | 59 | console.log(a);
|
| 60 | + |
| 61 | +//5.4 |
30 | 62 | var round =Math.round(7.25);
|
| 63 | + |
| 64 | +//5.6 |
31 | 65 | console.log(round)
|
32 | 66 |
|
33 |
| -let arrays = |
34 |
| -console.log("I think variable arrays is related to animals"); |
| 67 | +//6.1 |
| 68 | +let arrays; |
| 69 | + |
| 70 | +//6.2 |
| 71 | +console.log("I think the value will be undefined"); |
| 72 | + |
| 73 | +//6.3 |
35 | 74 | console.log(arrays);
|
| 75 | + |
| 76 | +//6.4 |
36 | 77 | let myFavoriteAnimals = [cat, dog, sheep];
|
| 78 | + |
| 79 | +//6.5 |
37 | 80 | console.log(myFavoriteAnimals);
|
| 81 | + |
| 82 | +//6.6 |
38 | 83 | let favoriteAnimalOfDaan = "baby pig";
|
39 |
| -const animals = "myFavoriteAnimals" + "" + "favoriteAnimalOfDaan"; |
| 84 | +const animals = myFavoriteAnimals + "" + favoriteAnimalOfDaan; |
| 85 | + |
| 86 | +//6.7 |
40 | 87 | console.log(animals);
|
41 | 88 |
|
| 89 | +//7.1 |
42 | 90 | let myString = "this is a test";
|
| 91 | + |
| 92 | +//7.2 |
43 | 93 | console.log(myString);
|
44 |
| -console.log(myString ["length"]); |
45 | 94 |
|
| 95 | +//7.3 |
| 96 | +console.log(myString.length); |
| 97 | + |
| 98 | +//8.1 |
46 | 99 | let num = 11;
|
47 | 100 | let address = "Huygenhoekring";
|
48 | 101 | let supermarkets = ["Lidl", "Dekka", "Jumbo"];
|
49 | 102 | let booleans = true, false, true;
|
| 103 | + |
| 104 | +//8.2 |
50 | 105 | console.log(num);
|
51 | 106 | console.log(address);
|
52 | 107 | console.log(supermarkets);
|
53 | 108 | console.log(booleans);
|
54 |
| -console.log(I think the type of num is number, |
55 |
| - type of address is string, |
56 |
| - type of supermarkets is array and |
57 |
| - type of booleans is boolean.); |
| 109 | + |
| 110 | +//8.3 |
| 111 | +console.log("I think the type of num is number, type of address is string, type of supermarkets is array and type of booleans is boolean."); |
| 112 | + |
| 113 | +//8.4 |
58 | 114 | console.log(typeof num);
|
59 | 115 | console.log(typeof supermarkets);
|
60 | 116 | console.log(typeof booleans);
|
61 | 117 | console.log(typeof address);
|
62 | 118 |
|
| 119 | +//8.5 |
63 | 120 | if (num != address) {
|
64 | 121 | console.log("num is a number and address is a string");
|
65 | 122 | }
|
66 | 123 |
|
| 124 | +//9.1 |
67 | 125 | let s = 7;
|
68 | 126 | let v = 3;
|
69 | 127 | let h = s % 3;
|
70 | 128 | console.log(s % h);
|
71 | 129 | console.log(s % v);
|
72 | 130 | console.log(v % h);
|
73 | 131 |
|
| 132 | +//10.1 |
74 | 133 | const mix = [5, "Shvan"];
|
75 | 134 | console.log(mix);
|
76 | 135 |
|
| 136 | +//10.2 |
77 | 137 | var maxNumber = Math.pow(6/0);
|
78 | 138 |
|
79 |
| -if (maxNumber === Infinity) |
| 139 | +//10.2 |
| 140 | +if (maxNumber === Infinity){ |
80 | 141 | console.log(0 / maxNumber);
|
| 142 | +} |
0 commit comments