Assalamualaikum!

I am Nizam

Student of Batch 07

Module 51 Practice


Video 51-1 Module Introduction and simple ema-john recap

Video 51-2 Run Github clone react project, Create Cart Component

Video 51-3 Calculate shopping cart price, shipping and tax with toFixed

Video 51-4 Setting the cart data on the localStorage for future retrieve

Video 51-5 (advanced) Load cart from local storage, find product

Video 51-6 (advanced) Display local storage cart to the UI

Video 51-7 (super advanced) Handle quantity from storage to cart

Video 51-8 Module summary, deploy, code recap


QUIZ

Q1: What type of things can we send via props?
Ans: array, object, function.

Q2:const findDevice= (id) => testArr.find(p=> p.id===id) if we want to add this function as an event handler to a button by passing a parameter, then which pattern is correct?
Ans: onClick={()=>findDevice(parameter)}

Q3:const student1= { name: "rafique", marks: 79, result: "A+" }; console.log(student1.mark + 1);
Ans: NaN

Q4:What is the purpose of “npm i --save <packageName>”? (google it)
Ans: Install and save the specified package.

Q5:Where will you find information about all the packages that you have installed in your react app?
Ans: package.json

Q6: Suppose you are trying to access something from local storage using localStorage.getItem() method ,and the item is not exist there. Then you will get___?
Ans: null

Q7: How can you pass a boolean value (true) as the prop named hero?(if needed google it)
Ans: <HeroComponent hero={true}/> and <HeroComponent hero/>

Q8: How we can access object properties?
Ans: Using dot notation; Using square bracket notation; by destructuring.

Q9: What will be printed on the console when the following code is executed in JavaScript? const obj = {name :'jack',age:27} const a= 'name' in obj; console.log(a)
Ans: true

Q10: What is the purpose of the dependency array in useEffect?
Ans: re-run the effect when the values within the array change across re-renders.

The End

Copyright ©2023 Allright Reserved