In this part we want to click the red button such that the specific cut is deleted.
For example if we click on this button this card will be deleted.
So now we need to create a new function.
My name is at David handler
in order to let we know which card is going to be the letter.
He need to know the index.
So we have to add the index here
and also we are going to bind a MFA so we add a you've read this and now on delete is equal to delete
top handler
and since we are going to pass the index to the function so we will use the arrow function
and we go back to the top of the S and since we are going to delete we need to buy it is by the own
delete method too on click.
So we will pass the Pop thought on delete.
Now we back to the party s and go to the delete content handler and we will pass the com index
and we want to make a copy.
Off the cuff so we let the constant cuts copy equal to cost.
The cost is at here.
So after we get the index we will delete the specific one.
So we will you think this buys
and then reset cost.
Now we try to delete the count.
Nothing happened.
Why.
Because it tried to console lock the top copies and the cops took take a look.
So if we click on the daily you will see both of them have the same number of cars.
Even the car's only has two cars.
This is because at this stage the cars also delete one card.
This is because our race is reference type.
So in order to really make a copy as we discussed it before we need to use the spare operator
now we can take a look again.
If we did it one you would see the cars.
We did delete it.
So the cards copy only has to talk and the cars still have free cast before set cars.
This is how the U.S. stay work.
If we see there a little difference of the data they will not make any changes.
So we have to make some changes so that before the set tops the cars weaving the cars and we may have
free cars and the cars copy only has to cost so that we will note oh there is some different.
And then it will we render the whole page.