pull/243/merge
JoemonV-Reflections 7 months ago committed by GitHub
commit 884232f37c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -1724,7 +1724,7 @@ for (let i = 0; i < 3; i++) {
// console.log(i), Uncaught ReferenceError: gravity is not defined // console.log(i), Uncaught ReferenceError: gravity is not defined
``` ```
The scope _let_ and _const_ is the same. The difference is only reassigning. We can not change or reassign the value of const variable. I would strongly suggest you to use _let_ and _const_, by using _let_ and _const_ you will writ clean code and avoid hard to debug mistakes. As a rule of thumb, you can use _let_ for any value which change, _const_ for any constant value, and for array, object, arrow function and function expression. The scope _let_ and _const_ is the same. The difference is only reassigning. We can not change or reassign the value of const variable. I would strongly suggest you to use _let_ and _const_, by using _let_ and _const_ you will write clean code and avoid hard to debug mistakes. As a rule of thumb, you can use _let_ for any value which change, _const_ for any constant value, and for array, object, arrow function and function expression.
### 7. Object ### 7. Object
@ -2133,10 +2133,12 @@ const products = [
``` ```
Imagine you are getting the above users collection from a MongoDB database. Imagine you are getting the above users collection from a MongoDB database.
a. Create a function called signUp which allows user to add to the collection. If user exists, inform the user that he has already an account.
a. Create a function called signUp which allows user to add to the collection. If user exists, inform the user that he has already an account.
b. Create a function called signIn which allows user to sign in to the application b. Create a function called signIn which allows user to sign in to the application
3. The products array has three elements and each of them has six properties. 3. The products array has three elements and each of them has six properties.
a. Create a function called rateProduct which rates the product a. Create a function called rateProduct which rates the product
b. Create a function called averageRating which calculate the average rating of a product b. Create a function called averageRating which calculate the average rating of a product

@ -14,7 +14,7 @@
</div> </div>
[<< Day 20](../20_projects/20_projects.md) | [Day 22>>]() [<< Day 20](../20_projects/20_projects.md) | [Day 22>>](../22_Form_Using_Hooks/22_form_using_hooks.md)
![30 Days of React banner](../images/30_days_of_react_banner_day_21.jpg) ![30 Days of React banner](../images/30_days_of_react_banner_day_21.jpg)
@ -404,4 +404,4 @@ ReactDOM.render(<App />, rootElement)
Convert everything you wrote to React hooks. Convert everything you wrote to React hooks.
🎉 CONGRATULATIONS ! 🎉 🎉 CONGRATULATIONS ! 🎉
[<< Day 20](../20_projects/20_projects.md) | [Day 22>>]() [<< Day 20](../20_projects/20_projects.md) | [Day 22>>](../22_Form_Using_Hooks/22_form_using_hooks.md)

Loading…
Cancel
Save