list and keys
- What does .map() return?
- Map returns the new array
- If I want to loop through an array and display each value in JSX, how do I do that in React?
- Each list item needs a unique __.
- What is the purpose of a key?
- to indentify what has moved or been modified
The Spread Operator
- What is the spread operator?
- it is three dots to expand itarable objects in the list of arguments
- List 4 things that the spread operator can do.
- Give an example of using the spread operator to combine two arrays.
- â[âĶ[âððððĪŠðâ]]
// Array
[ âððððĪŠðâ ]
[âĶâððððððĨ°ððĪĐ!â] // Array(9) [
âðâ, âðâ, âðâ, âðâ, âðâ, âðĨ°â, âðâ, âðĪĐâ, â!â ]`
const hello = {hello: "ððððĪŠð"}
const world = {world: "ððððððĨ°ððĪĐ!"}
const helloWorld = {...hello,...world}
console.log(helloWorld)
// Object { hello: "ððððĪŠð", world:
"ððððððĨ°ððĪĐ!" }
- Give an example of using the spread operator to add a new item to an array.
- Give an example of using the spread operator to combine two objects into one.
How to Pass Functions Between Components
- In the video, what is the first step that the developer does to pass functions between components?
- create the function wherever the state is
- In your own words, what does the increment function do?
- modifying an array
- finding the name
- its going to loop through the array
- update our stat object
- How can you pass a method from a parent component into a child component?
- How does the child component invoke a method that was passed to it from a parent component?