1
00:00:00,510 --> 00:00:07,410
Let us continue and trigonal and let us begin our visas to your cards and let us come in our function,

2
00:00:08,520 --> 00:00:15,060
which is it cuts in function at this and let us come here.

3
00:00:15,060 --> 00:00:21,450
The first thing to do, we are going to define a couple things, not let us confess or let us come,

4
00:00:21,450 --> 00:00:25,100
first of all, in our states and create a model data.

5
00:00:25,590 --> 00:00:27,540
We're going to court is the tarka.

6
00:00:29,640 --> 00:00:35,600
Cut items like these cuts items, and it will be in Iraq.

7
00:00:35,770 --> 00:00:40,140
OK, so let us take it as Crothall.

8
00:00:43,130 --> 00:00:50,720
We are going to define a A constants, a constants in which we are going to assign our records in order

9
00:00:50,720 --> 00:00:59,350
to respect the immutability condition because we are going through a multitude, are a copy and offer

10
00:00:59,370 --> 00:01:08,050
that we are going to update our record items states, OK, our ID card team card items, data breaches

11
00:01:08,090 --> 00:01:08,950
in our states.

12
00:01:09,200 --> 00:01:10,770
So let us see what I'm going to do.

13
00:01:10,790 --> 00:01:17,060
The first thing, I'm going to create a new contest and I'm going to name this Konstanz card items and

14
00:01:17,060 --> 00:01:28,070
cart items is going to be equal to this that states this, that the states that cart items and I going

15
00:01:28,070 --> 00:01:35,900
to say is equal to slice and I'm going to copy, I think that I have in my cart items.

16
00:01:36,290 --> 00:01:42,260
And after that, certain words I'm going to do and I'm going to declare it variable.

17
00:01:42,260 --> 00:01:46,040
That's ambulant name late already.

18
00:01:49,250 --> 00:01:56,520
Ein carped like this lady thought, I'm going to finish, I'm going to initialize this in force.

19
00:01:56,860 --> 00:02:01,910
OK, so let us scroll down and the first thing I'm going to do, I'm going to say if.

20
00:02:04,230 --> 00:02:07,470
I don't have something if nothing is in cards.

21
00:02:07,530 --> 00:02:10,530
OK, and I'm going to call already.

22
00:02:12,820 --> 00:02:20,290
Yes, if nothing is incorrect, then you are going to put something in court in small means, you can

23
00:02:20,290 --> 00:02:27,850
see cut items is empty because that is empty because our estates are cut items.

24
00:02:27,850 --> 00:02:31,660
That's how it is in our our state is also empty.

25
00:02:32,170 --> 00:02:38,470
And we are going to take all properties that we have here in our cart items like our cart items.

26
00:02:38,740 --> 00:02:48,280
So it is in our estate is an array and the items constants will be also be a and if we have something

27
00:02:48,280 --> 00:02:55,030
here and we are going to copy all things that we have here and we are going to assign these items,

28
00:02:55,640 --> 00:03:02,560
OK, and if we want to add in other things, we are going to mutate card items constants instead of

29
00:03:02,560 --> 00:03:04,960
everything to mutate directly our estate.

30
00:03:05,170 --> 00:03:11,800
And yes, we are going to take the card items contents and we are going to assign it by using the we

31
00:03:11,800 --> 00:03:19,030
are going to assign it to our items by using the sets that function in order to avoid the immutability

32
00:03:20,200 --> 00:03:28,080
and immutably in order to to respect the immutability condition in which case.

33
00:03:28,420 --> 00:03:32,110
So here we are going to say because by default it is false, false.

34
00:03:32,320 --> 00:03:37,390
And if we say like this does mean it is true that the condition is going to be verified.

35
00:03:37,450 --> 00:03:45,430
OK, and if nothing is in cards, if we reserve like this, that means if nothing is in cards.

36
00:03:45,580 --> 00:03:48,460
OK, because here we have a card.

37
00:03:48,460 --> 00:03:54,750
And if we read this, we put this exclamation mark, we are going to say if nothing is in cards.

38
00:03:54,820 --> 00:04:01,900
So what you want to you are going to take in your will to take these events.

39
00:04:01,930 --> 00:04:09,520
OK, because by clicking on the bottom, we are going to get the specific objects in which we can take

40
00:04:09,520 --> 00:04:12,580
all properties of the elements of the vector.

41
00:04:12,580 --> 00:04:17,770
And we are going to take this and we are going to take these objects.

42
00:04:18,190 --> 00:04:22,750
And if nothing is in cards, then put it put it in our card.

43
00:04:22,770 --> 00:04:23,920
So what's Recknagel?

44
00:04:24,040 --> 00:04:30,040
You're going to call our Konstanz card items that we can say push.

45
00:04:30,400 --> 00:04:35,350
And you know, the push function is in order to ID something in your array.

46
00:04:35,810 --> 00:04:40,240
And here we are going to say we're going to be using disparate elements.

47
00:04:40,390 --> 00:04:47,020
These parades put they call that means we're going to copy all things that we have in our room.

48
00:04:47,110 --> 00:04:59,260
They call and then we are going to create a new a new sales in our rate that we counts in order to have

49
00:05:00,250 --> 00:05:02,620
the number of the numbers.

50
00:05:02,620 --> 00:05:10,060
Time that we have clicked on the send button and counts for the first time is going to be equal to one.

51
00:05:10,210 --> 00:05:11,740
OK, very good.

52
00:05:11,770 --> 00:05:16,510
And let us back here to try to see what's ahead, like your reaction.

53
00:05:16,520 --> 00:05:24,760
So let us make a consult log and or a console like we are going through puts our cards.

54
00:05:27,080 --> 00:05:36,260
Items like this can items and you're going to display our items in our console, so let us right click

55
00:05:36,260 --> 00:05:42,470
click on Inspect, you're going to inspect, click on console if I try to click here.

56
00:05:43,250 --> 00:05:46,400
OK, so let us open to see what we're going to have.

57
00:05:46,870 --> 00:05:52,290
Like here is country image Nissan.

58
00:05:52,460 --> 00:06:00,860
The point is, listen, I can't and we have all that means we have one thing in our Ricard's one product.

59
00:06:00,860 --> 00:06:06,130
And if I click here and there, I go back here in this moment.

60
00:06:06,740 --> 00:06:14,090
Yes, we have a car, a car to OK, we have car through.

61
00:06:20,730 --> 00:06:26,670
And count is equal to one like this, it is very large for.

62
00:06:34,520 --> 00:06:35,360
The length.

63
00:06:44,300 --> 00:06:47,000
Hendrika sake's like.

64
00:06:53,830 --> 00:07:04,570
And let us suppose that we we we to a we have it needs some work and let us click on it.

65
00:07:10,080 --> 00:07:12,510
And you're going to see it read perfectly.

66
00:07:12,540 --> 00:07:18,900
So the thing we're going to do is to make our visual calls after testing these parts, what's required.

67
00:07:19,080 --> 00:07:25,610
We are going to come here and what we're going to say, we are going to call the city state function.

68
00:07:25,620 --> 00:07:30,470
We're going to say that state state function, OK?

69
00:07:30,840 --> 00:07:37,010
And here we are going to say items like ATMs are items.
