What does .map() return? It returns a new array with each element transformed by a callback function.
If I want to loop through an array and display each value in JSX, how do I do that in React? Use .map() to loop through the array and return a JSX element for each value.
Each list item needs a unique __. Key
What is the purpose of a key? To help React identify which items have changed, added, or removed in a list.
What is the spread operator? JavaScript syntax that allows an iterable to expand in place.
List 4 things that the spread operator can do. Copy/concatenate arrays, copy/merge objects.
Give an example of using the spread operator to combine two arrays. const combinedArray = […array1, …array2];
Give an example of using the spread operator to add a new item to an array. const newArray = […originalArray, 4];
Give an example of using the spread operator to combine two objects into one. const combinedObject = {…object1, …object2};
In the video, what is the first step that the developer does to pass functions between components? Define a function in the parent component.
In your own words, what does the increment function do? Increases the value of a count by one.
How can you pass a method from a parent component into a child component? Pass the method as a prop to the child component.
How does the child component invoke a method that was passed to it from a parent component? The child component can invoke the method by calling it using props.