1 00:00:02,150 --> 00:00:08,150 Have one welcome back in this lesson we're going to talk about one of the most fundamental aspects of 2 00:00:08,180 --> 00:00:15,260 any programming language and that is a use of collections of collections such as arrays or sets or dictionaries. 3 00:00:15,260 --> 00:00:22,250 They help us put objects of the same nature or different type into a container. 4 00:00:22,250 --> 00:00:24,500 Now why would we need to do that. 5 00:00:24,560 --> 00:00:30,260 We would need to put objects of the same type in an array so that we can have an order between them. 6 00:00:30,260 --> 00:00:36,080 Imagine you want to have the days of the week as store somber as opposed to saying we want to string 7 00:00:36,080 --> 00:00:40,230 for Monday that a string for Tuesday resting thing for Wednesday. 8 00:00:40,310 --> 00:00:46,970 So on and so forth I could put all of them into one object only and then go to the other and find the 9 00:00:46,970 --> 00:00:48,410 ones that I need. 10 00:00:48,410 --> 00:00:52,010 So let's jump in to exclude And let's get started. 11 00:00:52,010 --> 00:00:59,380 So we get a better understanding of how it works when I go through ex-cult in here I'm going to start 12 00:00:59,380 --> 00:01:07,780 a new project me close that one first and then I start your project my voice command line tool is called 13 00:01:08,000 --> 00:01:11,850 arrays sex. 14 00:01:12,100 --> 00:01:15,090 Scott It doesn't matter what you call it anxiety. 15 00:01:15,260 --> 00:01:19,160 So just go ahead and start our very first array. 16 00:01:19,280 --> 00:01:23,870 As always I'm going to clear this thought I'm going to get myself is better for my thing. 17 00:01:26,150 --> 00:01:29,250 So the first thing I want to do is I want to declare an array. 18 00:01:29,310 --> 00:01:39,560 I'm going to say and this array it is called are days array and that is declaring an array. 19 00:01:39,570 --> 00:01:42,640 Now the next thing I have to do is and this is quite important. 20 00:01:42,660 --> 00:01:46,290 I have to both allocate and initialize an array. 21 00:01:46,310 --> 00:01:52,380 And this is a topic we haven't really seen much in the past and we will talk about it much much more 22 00:01:52,380 --> 00:01:54,180 details in the future. 23 00:01:54,210 --> 00:02:01,640 So the next thing is allocation and initialization which is done like this. 24 00:02:01,740 --> 00:02:11,910 Désirée is A.R.T. allocate and initialized with some objects without those objects were the only objects 25 00:02:11,910 --> 00:02:13,410 that they want to put in my array. 26 00:02:13,560 --> 00:02:16,290 Well one of them is Monday. 27 00:02:16,950 --> 00:02:25,100 The other one is Tuesday and then the next one is Wednesday Wednesday. 28 00:02:25,590 --> 00:02:31,740 And let's say I only needed for four days of the week and whenever you put in the middle that means 29 00:02:31,740 --> 00:02:36,130 this is the end of every simply because arrays don't have a limit. 30 00:02:36,150 --> 00:02:38,770 You can put as many objects as you want into them. 31 00:02:39,000 --> 00:02:44,200 And when we are initializing them we need a way of saying well this is the end of the entry. 32 00:02:44,460 --> 00:02:50,310 So I put that on a very common practice is the stacking your objects like this. 33 00:02:50,310 --> 00:02:57,710 So I'm going to say that that kind of you know you can see all of them together. 34 00:02:57,750 --> 00:02:59,570 Now let's see what we have done. 35 00:02:59,760 --> 00:03:07,560 We have declared an array and we are located then initialize the lock and initialized with these objects. 36 00:03:07,560 --> 00:03:10,540 That's essentially like doing it definition of it. 37 00:03:10,650 --> 00:03:18,000 So we had a declaration and we have that definition and now we have an array with all the objects. 38 00:03:18,300 --> 00:03:19,830 Let's see what's that order. 39 00:03:19,830 --> 00:03:25,930 So the very first object it is not what we call index 0. 40 00:03:26,460 --> 00:03:34,270 Then the next object is that index 1 and you can imagine as we go along this will become index. 41 00:03:34,280 --> 00:03:37,160 This will become index 3 so on and so forth. 42 00:03:37,320 --> 00:03:43,440 So we have so many many objects in our array and they are all or that which is quite an important aspect 43 00:03:43,440 --> 00:03:46,340 of an array being ordered. 44 00:03:46,530 --> 00:03:48,740 So how did we get access to these objects. 45 00:03:48,810 --> 00:03:54,730 Let's go ahead and say I wanted preens the element that is indexed too. 46 00:03:54,780 --> 00:03:59,800 So I'm going to say and it's like perience or whatever you find. 47 00:04:00,060 --> 00:04:08,880 Or let's say object not in the next two years is just like what I've done before. 48 00:04:08,880 --> 00:04:17,340 And here I'm going to say désirée object at index 2 for instance. 49 00:04:17,370 --> 00:04:26,580 So this line will now print the object that index to is a space and then if you look for any object 50 00:04:26,580 --> 00:04:28,200 that it finds in here. 51 00:04:28,470 --> 00:04:30,250 So in here we're going to run this. 52 00:04:30,310 --> 00:04:37,100 Right we're going to say days are a find object that likes to run it and see what we get if we get Wednesday 53 00:04:37,110 --> 00:04:39,740 it means everything we've done has worked properly. 54 00:04:44,120 --> 00:04:48,530 It's like this object of next to is Wednesday. 55 00:04:48,710 --> 00:04:53,670 Now the next question is how will I know how many objects are in my array. 56 00:04:53,750 --> 00:04:55,050 I could do something like that. 57 00:04:55,100 --> 00:04:59,930 I could say and like anyway as I'm going to stay there. 58 00:04:59,960 --> 00:05:01,140 All right. 59 00:05:01,140 --> 00:05:12,180 And then because that integer objects in my array obviously now and the slug is expecting us to feed 60 00:05:12,180 --> 00:05:19,650 it some sort of an integer value and that integer value is a day's array that count. 61 00:05:19,850 --> 00:05:24,110 So that's essentially going to return the count of the array for us. 62 00:05:24,110 --> 00:05:31,840 We do get a warning in here and that's primarily because days that Chowhound is not of the type integer. 63 00:05:31,940 --> 00:05:33,220 Let's have a look at it. 64 00:05:33,530 --> 00:05:34,060 Count. 65 00:05:34,100 --> 00:05:37,640 It is actually and this unsigned integer. 66 00:05:37,760 --> 00:05:43,550 So to do to properly format that I could actually say l you. 67 00:05:43,730 --> 00:05:51,320 So instead of printing integer go on preens l you for us if you don't remember this you can obviously 68 00:05:51,320 --> 00:05:55,440 refer to that Apple document that we had a few lessons ago. 69 00:05:55,640 --> 00:05:58,920 And also you could actually rely on ex-coach to fix it for you. 70 00:05:58,940 --> 00:06:05,600 So in this case I would just go to this morning and it says well it's an unsigned long so fix it and 71 00:06:05,600 --> 00:06:08,140 it says well you have to make it l you. 72 00:06:08,330 --> 00:06:10,910 And that's pretty much does the work for us. 73 00:06:10,910 --> 00:06:16,910 Now I'm going to go ahead and fix it manually again because I don't want to force it over there and 74 00:06:16,910 --> 00:06:18,990 let's print this let's see what we get. 75 00:06:20,960 --> 00:06:23,750 And now it says object that index 2 is a state. 76 00:06:23,750 --> 00:06:25,780 Obviously one thing hasn't changed. 77 00:06:25,790 --> 00:06:28,760 There are four objects in my array. 78 00:06:28,760 --> 00:06:30,220 0 1 2 3. 79 00:06:30,230 --> 00:06:32,350 Those are the indexes on 1 2 3 4. 80 00:06:32,350 --> 00:06:34,000 Those are the numbers of them. 81 00:06:34,340 --> 00:06:38,990 Now the next question that happens is what if I wanted to add the Friday here. 82 00:06:38,990 --> 00:06:43,760 Is there a way for me to add another day to the day's array. 83 00:06:43,850 --> 00:06:45,970 And as you can imagine the answer is No. 84 00:06:45,980 --> 00:06:49,710 Simply because we're using an innocent array. 85 00:06:49,940 --> 00:06:56,120 If you remember from our analysis string lesson if you want to be able to modify your values they have 86 00:06:56,120 --> 00:06:57,580 to become mutable. 87 00:06:57,770 --> 00:07:05,990 So go ahead and do that when I go in here and say instead of this array and this mutable array obviously 88 00:07:05,990 --> 00:07:07,790 if it isn't in it's mutable. 89 00:07:08,070 --> 00:07:09,940 That's my initialization. 90 00:07:09,950 --> 00:07:13,010 It has to be code in this mutable array as well. 91 00:07:13,190 --> 00:07:18,620 And now I have eight days or eight which is in this immutable array and it has Monday Tuesday Wednesday 92 00:07:18,620 --> 00:07:29,180 Thursday and I'm printing the counterfit and then I'm saying days array and objects and I'm going to 93 00:07:29,180 --> 00:07:34,010 add Friday and what the object does. 94 00:07:34,160 --> 00:07:37,980 It goes to the end of the array and adds one more object to it. 95 00:07:38,150 --> 00:07:39,930 And if the prince the counterfeits. 96 00:07:39,950 --> 00:07:43,180 Now I'm going to print it here one more time. 97 00:07:44,980 --> 00:07:51,460 You will see that at the beginning there are four objects in my array that is here when we are the Friday. 98 00:07:51,490 --> 00:07:54,880 I can't see that there are five objects in my area. 99 00:07:55,290 --> 00:08:01,600 Now to be printed the Wednesday this is using the object that index method. 100 00:08:01,780 --> 00:08:07,060 I want to quickly talk about the use of these methods on the dots you know operation and everything 101 00:08:07,060 --> 00:08:13,900 in here even though we have a lesson for methods and functions it kind of helps us understand why we 102 00:08:13,900 --> 00:08:16,270 are doing some of the things that we are doing. 103 00:08:16,270 --> 00:08:24,190 So things such as an array or mutable array they have a built in method called object that index. 104 00:08:24,250 --> 00:08:31,270 It means you use a square bracket the name of your object the name of your array and then you say object 105 00:08:31,270 --> 00:08:35,550 that index and you feel that the index that you want gets back to you. 106 00:08:35,800 --> 00:08:36,800 So what is this one. 107 00:08:36,800 --> 00:08:39,250 What are we using at DOT operation. 108 00:08:39,280 --> 00:08:46,330 We will see this in more detail when we talk about classes and objects but some methods such as count 109 00:08:46,390 --> 00:08:48,270 they can be used both ways. 110 00:08:48,310 --> 00:08:49,240 They can be used. 111 00:08:49,450 --> 00:09:00,380 A dot count or they can be used as this day's array chart that is essentially called a dot operation. 112 00:09:00,400 --> 00:09:07,090 This is called the method calling in here and I'm calling a method called count which returns the count 113 00:09:07,090 --> 00:09:14,080 of an array in here and using a dot operation which accesses the property count of the houri. 114 00:09:14,170 --> 00:09:17,740 They mostly exactly the same thing and we get the same result. 115 00:09:17,740 --> 00:09:23,000 Not exactly the same result but we get the same return essentially. 116 00:09:23,140 --> 00:09:27,810 There's also a much easier way for getting the different elements from the array. 117 00:09:27,850 --> 00:09:32,200 So let's say you want to print the object that is at the end of my array. 118 00:09:32,410 --> 00:09:37,280 So I'm going to go ahead and say and Aslaug in the end. 119 00:09:37,340 --> 00:09:43,890 I'm going to say the last object is and it's going to be something. 120 00:09:43,990 --> 00:09:53,360 What is that thing that thing is going to be days array object that index number right count now or 121 00:09:53,590 --> 00:09:56,280 not. 122 00:09:56,600 --> 00:10:01,740 So again you get my space is array does count. 123 00:10:01,750 --> 00:10:03,420 Now here's the thing. 124 00:10:03,610 --> 00:10:09,480 If you can imagine this are how it would work you should expect this application to crash. 125 00:10:09,640 --> 00:10:16,210 And I will show you why and we'll run the application and it's going to crash and the crash report says 126 00:10:17,010 --> 00:10:21,160 in the X5 beyond bounds 0 2 4. 127 00:10:21,160 --> 00:10:24,800 So it's saying you're trying to access an element that doesn't exist. 128 00:10:24,910 --> 00:10:26,230 But how is that possible. 129 00:10:26,230 --> 00:10:27,840 I'm looking at the count. 130 00:10:27,930 --> 00:10:33,930 The thing is currently we have 0 1 2 and 3 indexes. 131 00:10:34,090 --> 00:10:42,100 So the last index that we can use is 3 even though our count is 4 after we have the Friday. 132 00:10:42,100 --> 00:10:45,670 This is going to be 0 1 2 3 and 4. 133 00:10:45,730 --> 00:10:51,300 So the indexes are 0 to 4 while the count is 5 essentially in here. 134 00:10:51,310 --> 00:10:58,940 I'm saying désirée object that index 5 which simply doesn't exist is saying you only have indexes zero 135 00:10:58,940 --> 00:10:59,700 to 4. 136 00:10:59,890 --> 00:11:05,320 So if I want to find the last object I can say count minus 1. 137 00:11:05,470 --> 00:11:08,940 And that's always the last object of an array. 138 00:11:11,100 --> 00:11:13,820 And now it's as last object is Friday. 139 00:11:13,890 --> 00:11:17,090 There is also an easier way for writing this. 140 00:11:17,140 --> 00:11:19,170 I'm going to rewrite it again. 141 00:11:19,260 --> 00:11:22,920 This is called using a subscript in a subscript. 142 00:11:22,920 --> 00:11:31,330 We do this we say désirée and then we open brackets and we say say four. 143 00:11:31,620 --> 00:11:35,740 So it will print the elements number four for us. 144 00:11:35,810 --> 00:11:41,130 Of course this is a little bit different than this one because in this one we are doing it statically 145 00:11:41,130 --> 00:11:43,500 we we're always looking at number four. 146 00:11:43,610 --> 00:11:49,610 But here we are doing it dynamically and you're looking at the count minus one which happens to be four. 147 00:11:49,640 --> 00:11:52,040 In this example but not always. 148 00:11:52,040 --> 00:11:55,960 So if I want to I could actually grab this and put it there. 149 00:11:56,020 --> 00:12:01,160 And if you want to be very specific and with much further you know practice you could actually do something 150 00:12:01,160 --> 00:12:01,730 like this. 151 00:12:01,730 --> 00:12:10,770 You could say in the last index his days array dot count minus 1. 152 00:12:10,820 --> 00:12:13,510 So that is the last index. 153 00:12:13,550 --> 00:12:15,800 This is the one that I want to see. 154 00:12:15,800 --> 00:12:18,440 Days are the last index. 155 00:12:18,440 --> 00:12:22,140 So let's print the. 156 00:12:22,260 --> 00:12:29,310 So we got Friday again and again we got the same warming's saying that this guy is actually an unsigned 157 00:12:29,310 --> 00:12:35,080 long while this guy is going to be an integer and you can let X gotta fix it for you if you want you 158 00:12:35,080 --> 00:12:36,910 can force fix it yourself. 159 00:12:37,110 --> 00:12:42,930 To force ourselves the thing you have to do is you have to come to your count and you have to say I'm 160 00:12:42,930 --> 00:12:45,530 going to cast it into an integer. 161 00:12:45,610 --> 00:12:47,810 Again don't worry about this exactly. 162 00:12:47,810 --> 00:12:50,340 We'll talk more about casting in the future. 163 00:12:50,340 --> 00:12:56,780 But casting essentially means taking one type of event and forcing it into another one. 164 00:12:56,790 --> 00:13:01,150 So because these are that count wasn't the type that we expect that. 165 00:13:01,200 --> 00:13:07,690 I said take it and convert it into an integer and put it into my integer of course. 166 00:13:07,740 --> 00:13:13,830 Casting is a little bit of a risky process because you have to be sure the objects that can be converted 167 00:13:13,830 --> 00:13:14,720 to each other. 168 00:13:14,880 --> 00:13:22,080 For instance I know an unsigned integer can't simply be or sorry an unsigned long can be converted 20 169 00:13:22,080 --> 00:13:26,820 integer but that's not the case between let's say an integer and a string. 170 00:13:26,820 --> 00:13:32,680 So once the time comes we'll talk more about the casting and how we have to be certain about what we 171 00:13:32,690 --> 00:13:34,670 are trying to combat. 172 00:13:34,680 --> 00:13:41,530 So the next thing you want to talk about are sets and what's the difference between a set and an array. 173 00:13:41,790 --> 00:13:45,910 Let's jump into Apple's own documentation on in here. 174 00:13:45,910 --> 00:13:50,150 There is a picture that explains that for get the picture in the middle part. 175 00:13:50,190 --> 00:14:00,180 And these are eight years or third set of objects that is 0 1 2 2 for ABC and a set is an on or that 176 00:14:00,180 --> 00:14:08,190 set of objects a easy g b c something to keep in mind is that because in a sense or not or that you 177 00:14:08,190 --> 00:14:11,330 cannot have the same object happened twice. 178 00:14:11,340 --> 00:14:17,190 So all objects must be unique but in an array they don't have to be unique. 179 00:14:17,190 --> 00:14:18,930 Now let's go back to school. 180 00:14:18,990 --> 00:14:20,410 Let's quickly try that. 181 00:14:20,510 --> 00:14:24,560 So in here I could actually have two copies of Wednesday. 182 00:14:24,630 --> 00:14:26,520 You know it would be perfectly fine. 183 00:14:26,580 --> 00:14:30,870 You might have a situation that your OP is dealing with. 184 00:14:31,020 --> 00:14:37,200 I don't know a certain number of users on the same user happens to be twice maybe the same user has 185 00:14:37,530 --> 00:14:38,850 commented twice. 186 00:14:38,850 --> 00:14:41,140 And that's why there is two copies of it there. 187 00:14:41,310 --> 00:14:46,630 So in an array that's perfectly fine because they're all there and this means they would get indexed 188 00:14:46,650 --> 00:14:47,230 too. 189 00:14:47,370 --> 00:14:49,580 Well this one would get indexed 3. 190 00:14:49,710 --> 00:14:59,270 However when you deal with sets and this is how you do a set and I said to my set is an asset. 191 00:15:00,310 --> 00:15:08,600 And in it the objects and the objects say Sunday and only say Monday for now. 192 00:15:08,700 --> 00:15:09,990 There's only two of them. 193 00:15:10,260 --> 00:15:17,320 And in this they actually have to be you have to be unique simply because there's no order between them. 194 00:15:17,460 --> 00:15:23,790 And now why isn't that an order between them because when there is no or there disparity between them 195 00:15:23,790 --> 00:15:26,910 which is hashing between them happens a lot faster. 196 00:15:27,090 --> 00:15:32,280 So in principle if you have an if you have an array or if you have a collection of objects that the 197 00:15:32,280 --> 00:15:38,920 order between them doesn't matter you can rely on sets if the order between them does not. 198 00:15:38,920 --> 00:15:42,380 Then you have to use arrays for the most part. 199 00:15:42,390 --> 00:15:47,690 We end up using arrays simply because the order matters to us from time to time. 200 00:15:47,700 --> 00:15:54,720 We end up using things such as set which all that doesn't matter and the objects are unique. 201 00:15:54,720 --> 00:16:00,620 Now you might be wondering if there is no or there how can I access different objects from set. 202 00:16:00,630 --> 00:16:08,310 I can not do things such as my set objects that index something because that order doesn't exist and 203 00:16:08,310 --> 00:16:12,530 that is true and I'm going to show you something that is coming up in a few lessons. 204 00:16:12,720 --> 00:16:16,200 So don't worry overly If you don't completely follow me. 205 00:16:16,380 --> 00:16:21,400 But here is how you do search within the set to find something. 206 00:16:21,570 --> 00:16:26,550 So in a set we say for and it's a string. 207 00:16:26,800 --> 00:16:38,460 Any in my set and then I'm going to say if any is equally strange and let's say I'm looking for Friday 208 00:16:38,460 --> 00:16:46,140 I'm trying to find out if an object as unique as Friday exists and I'm going to say and it's like there 209 00:16:46,260 --> 00:16:50,300 is a Friday or something to that effect. 210 00:16:50,310 --> 00:16:53,580 Now don't worry about this format in particular. 211 00:16:53,580 --> 00:16:59,520 This is a for loop which is a method of control flow and we'll talk about that in a few lessons in fact 212 00:17:00,000 --> 00:17:07,110 in this I'm going to say find all objects of the type in a string within this array within the set. 213 00:17:07,110 --> 00:17:14,970 So in my set go through them one other time this on and on and whatever is there if any of them is equal 214 00:17:14,970 --> 00:17:16,590 to the value of Friday. 215 00:17:16,680 --> 00:17:23,130 Then tell me that there is friday or do something with that phrase so on and so forth you will see a 216 00:17:23,130 --> 00:17:27,340 lot more of this when we talk about the for loops on control. 217 00:17:27,630 --> 00:17:28,890 In a few lessons. 218 00:17:28,980 --> 00:17:33,860 But for now just keep in mind that if there are sets it means the objects are unique. 219 00:17:34,080 --> 00:17:37,060 And also it means there is no order between them. 220 00:17:37,140 --> 00:17:42,720 So finally before I close this first and there is two more things that they should talk about. 221 00:17:42,750 --> 00:17:45,550 One of them is objects in an array. 222 00:17:45,600 --> 00:17:51,080 Don't have to necessarily be of the same nature even though we usually try to do that. 223 00:17:51,300 --> 00:17:53,560 But you could have an array such as this. 224 00:17:53,580 --> 00:18:03,880 And as I train my combined array and that is going to be an array lock in object. 225 00:18:04,050 --> 00:18:06,760 And one of my objects is a string. 226 00:18:07,140 --> 00:18:13,470 And then I have another object that let me put all the brackets so I know there are no arrows going 227 00:18:13,470 --> 00:18:14,050 up. 228 00:18:14,190 --> 00:18:15,810 And then I have another object. 229 00:18:15,810 --> 00:18:24,900 And this object is going to be R and this number number of its integer say 8. 230 00:18:24,900 --> 00:18:27,180 Don't worry about what an innocent number is. 231 00:18:27,180 --> 00:18:30,520 What does matter is that this is now a string. 232 00:18:30,600 --> 00:18:35,570 This one is not this thing is a different type of number different type of file. 233 00:18:35,760 --> 00:18:37,020 And that's perfectly fine. 234 00:18:37,020 --> 00:18:43,230 You can have it another array and sometimes it happens when you're reading values from networks or whatnot 235 00:18:43,530 --> 00:18:49,640 but when you're doing things on our own we try to maintain same type of value within an array. 236 00:18:49,950 --> 00:18:57,300 Finally there is another way of writing arrays which is essentially C Vai and all the array of writing 237 00:18:57,300 --> 00:19:03,930 arrays that doesn't offer us a lot of things that we could do it in this race or in it's notable arrays 238 00:19:03,960 --> 00:19:05,280 or in a set. 239 00:19:05,430 --> 00:19:07,550 But from time to time it's useful. 240 00:19:07,830 --> 00:19:09,220 And here is how we do it. 241 00:19:09,260 --> 00:19:18,690 I say it's my end just like how we have been defining and declaring integers but then we put two brackets 242 00:19:18,690 --> 00:19:21,590 in front of it and we say for instance 5. 243 00:19:21,750 --> 00:19:27,410 It means I want to have an array of integers with five elements. 244 00:19:27,540 --> 00:19:34,200 You have to decide about the number of items in it to right away right at the declaration time. 245 00:19:34,280 --> 00:19:43,230 When I say that is going to be one two three four and five. 246 00:19:43,350 --> 00:19:47,460 So I have an array now with five elements in it. 247 00:19:47,550 --> 00:19:53,240 Those are integers and the integers are these guys obviously in a situation like this. 248 00:19:53,250 --> 00:19:56,650 I can't change one of them to be string. 249 00:19:56,670 --> 00:20:01,530 I can't have something like this because then is going to give me an error saying well you said everything 250 00:20:01,530 --> 00:20:03,170 in here is going to be an integer. 251 00:20:03,180 --> 00:20:06,750 How come you're trying to force a string into it. 252 00:20:06,780 --> 00:20:08,710 So that's something to keep in mind. 253 00:20:08,910 --> 00:20:15,900 And also that you have to declare and define the number of objects in the array right at the very beginning 254 00:20:16,230 --> 00:20:18,820 which kind of limits what you are trying to do. 255 00:20:18,920 --> 00:20:21,680 But sometimes it might actually be useful. 256 00:20:22,690 --> 00:20:26,360 So that the writing is very good. 257 00:20:26,380 --> 00:20:27,630 We talk about arrays. 258 00:20:27,630 --> 00:20:33,940 We talked about mutable things we thought about how to get objects that indexes we talked about subscript 259 00:20:33,940 --> 00:20:36,160 mod to get access to objects. 260 00:20:36,220 --> 00:20:38,710 We talked about getting the count of finery. 261 00:20:38,770 --> 00:20:41,820 We talked about adding objects into an array. 262 00:20:42,070 --> 00:20:47,350 Something you probably didn't talk about is removing an object and that's actually quite simple you 263 00:20:47,350 --> 00:20:50,370 can say these array remove objects. 264 00:20:50,370 --> 00:20:57,940 We can either say remove this a specific object say or remove object Friday which is going to remove 265 00:20:58,000 --> 00:20:59,840 all instances of that. 266 00:21:00,010 --> 00:21:08,860 Or you could say désirée remove object at index if you know where you want to remove. 267 00:21:08,860 --> 00:21:12,710 I want to remove the object that is in the first ID. 268 00:21:12,740 --> 00:21:15,000 It is zero indexing zero. 269 00:21:15,310 --> 00:21:16,770 So that's another thing. 270 00:21:16,990 --> 00:21:24,520 And finally we talked about casting some of stuff we made a set we talked about hope for finding objects 271 00:21:24,520 --> 00:21:24,990 in a set. 272 00:21:24,990 --> 00:21:28,960 You have to iterate through them using a for loop or a similar. 273 00:21:29,350 --> 00:21:35,530 And at the end we spoke about having arrays with different types of Firebirds or values inside them 274 00:21:36,010 --> 00:21:41,250 and a C way of making array which is an all the way with that in mind. 275 00:21:41,260 --> 00:21:43,320 Let's move on to our next lesson.