|
1 |
| - |
2 | 1 | # JavaScript Full Course 2023
|
3 | 2 |
|
4 |
| -## Chapter 1 |
| 3 | +## Chapter 1 (Introduction) |
5 | 4 |
|
6 | 5 | ### Assignments
|
7 | 6 | **Question 1:** Difference Between "null" and "undefined" data type with example?
|
@@ -57,3 +56,125 @@ let c = 8;
|
57 | 56 | let result = a<b>c;
|
58 | 57 | console.log(result)
|
59 | 58 | ```
|
| 59 | +**Question 10:** If your state split into **four** equal parts such that in each part there are **1/4** number of people live. You have to find How many people would live in each part? |
| 60 | + |
| 61 | +## Chapter 2 (Conditional and iteration statement) |
| 62 | + |
| 63 | +### Assignments: |
| 64 | +**Question 1:** Explain practical use case of **break** and **continue** statement. When to use which **statement**? |
| 65 | + |
| 66 | +**Question 2:** Guess the **Output** and Explain Why? |
| 67 | +```js |
| 68 | +let i = 0; |
| 69 | +for(i;i<5;i++){ |
| 70 | +console.log(i); |
| 71 | +} |
| 72 | +``` |
| 73 | +**Question 3:** Write a simple **Program** in which You have to print first **10** number in **descending** order? |
| 74 | + |
| 75 | +**Question 4:** Lets say **John** is looking a new **country** to live in. |
| 76 | +He want to live in a country that speaks **English**, has less than 10 million people. One of the **food** option between these two must present **Spanish food** *Or* **English food**. |
| 77 | + |
| 78 | +**Write** an if statement to help john figure out Your country is right for him? |
| 79 | + |
| 80 | + |
| 81 | +**Question 5:** Guess the **Output** And Explain Why? |
| 82 | +```js |
| 83 | + for(let i = 0;i<10;i++{ |
| 84 | + console.log(i); |
| 85 | +} |
| 86 | + console.log(i) |
| 87 | +``` |
| 88 | +**Question 6:** use **nested-if** statement to check your **age>18** |
| 89 | +than check your height **height > 5.10**. |
| 90 | +If **both** true show any message(**I can sit in __ exam**) in the console? |
| 91 | + |
| 92 | +## Chapter 3 (Function) |
| 93 | +
|
| 94 | +### Assignments |
| 95 | +
|
| 96 | +**Question 1:** Create a **function Declaration** called **describeYourState** Which take three parameters 'Population', 'traditional food' and 'historical place'. Based on this input function should return a string with this format. |
| 97 | +**My state population is __. Its traditional food is __ and historical place name is __** |
| 98 | +
|
| 99 | +**Question 2:** Create a **function expression** which does the exact same thing as defined in **Question 1** |
| 100 | +
|
| 101 | +**Question 3:** What are **default values** of function. And How we can use them? |
| 102 | +
|
| 103 | +**Question 4:** Identify which **type** of value passed below into the function **greet()** |
| 104 | +
|
| 105 | +```js |
| 106 | +let person = { |
| 107 | +name:"john", |
| 108 | +age:25 |
| 109 | +} |
| 110 | +function greet(person){ |
| 111 | +person.name = `Mr ${person.name}` |
| 112 | +console.log(`Welcome ${person.name}`) |
| 113 | +} |
| 114 | +greet(person) |
| 115 | +``` |
| 116 | +
|
| 117 | +## Chapter 4 (Objects) |
| 118 | +
|
| 119 | +### Assignments |
| 120 | +
|
| 121 | +**Question 1:** Guess the **Output** And Explain Why? |
| 122 | +```js |
| 123 | +console.log(Math.round(Math.random() * 10 )); |
| 124 | +``` |
| 125 | +**Question 2:** Create an object called 'Country' for a country of your choice, containing properties 'country', 'capital', 'language', 'population' and 'neighbours' |
| 126 | +
|
| 127 | +1) Increase the country population by two million using **dot** notation. |
| 128 | +2) Decrease the country population by one million using **bracket** notation. |
| 129 | +
|
| 130 | +**Question 3:** Explain difference between **function** and **method** with the help of example? |
| 131 | +
|
| 132 | +**Question 4:** Guess the **Output** and explain Why? |
| 133 | +```js |
| 134 | +let car = { |
| 135 | +color:"Blue", |
| 136 | +model:2021, |
| 137 | +company:"Toyota" |
| 138 | +} |
| 139 | +let carColor = "Blue"; |
| 140 | +console.log(car[carColor]); |
| 141 | +console.log(car.carColor); |
| 142 | +``` |
| 143 | +**Question 5:** Explain **this** keyword with one real world example? |
| 144 | +
|
| 145 | +**Question 6:** Create a method **describeCar** inside *car* object in which you have to print like this in console using template literals |
| 146 | +
|
| 147 | +**Company of my car is __ . It color is __ And Model of my car is __** |
| 148 | +
|
| 149 | +**Question 7:** Generate random numbers between 0 and 10 using **trunc** method of **MATH** object |
| 150 | +
|
| 151 | +
|
| 152 | +
|
| 153 | +## Chapter 5 (DOM) |
| 154 | +
|
| 155 | +### Assignments |
| 156 | +
|
| 157 | +**Question 1:** Explain difference between **innerText** and **innerHTML** with the help of example? |
| 158 | +
|
| 159 | + |
| 160 | + ## Chapter 6 (Form Events) |
| 161 | + |
| 162 | +### Assignments |
| 163 | +
|
| 164 | +**Question 1:** Create regex for password with the following **validations**. |
| 165 | +
|
| 166 | +1) Length of password at least of 8 characters |
| 167 | +2) contain at least one special character |
| 168 | +3) contain at least one alphabet (a-z) character |
| 169 | +
|
| 170 | +
|
| 171 | +
|
| 172 | +
|
| 173 | +
|
| 174 | +
|
| 175 | +
|
| 176 | +
|
| 177 | + |
| 178 | +
|
| 179 | +
|
| 180 | +
|
0 commit comments