It creates a new array that itterates a new value for each value in the original array.
you use a map function but then use curly braces to build elements from that function.
to learn which items are changed/updated/or deleted/
it gives elements and identity.
Its basically using threee dots to call all things in an array, function arguments or objects.
Apply new operators, copying arrays, concatonating arrays, merging objects
const parts = [“shoulders”, “knees”]; const lyrics = [“head”, …parts, “and”, “toes”]; // [“head”, “shoulders”, “knees”, “and”, “toes”]
let arr1 = [0, 1, 2]; const arr2 = [3, 4, 5];
arr1 = […arr1, …arr2];
const obj1 = { foo: “bar”, x: 42 }; const obj2 = { foo: “baz”, y: 13 };
const clonedObj = { …obj1 }; // { foo: “bar”, x: 42 }
const mergedObj = { …obj1, …obj2 }; // { foo: “baz”, x: 42, y: 13 }
He creates a new function that updates the state
loops through the people array that addes to the count, then that to update the state.
he passes the component object into the child.
By updating state?