Hello and welcome to this lecture.
In this chair I'll be explaining to you what race are in the Ruby programming language.
What is an eerie and horray basically is an ordered into jeered in the next collection of objects.
Let me quickly explain what I mean by that.
Okay so he says there is an audit.
What that means is that the way the objects of variables are arranged inside an array they are all you
can think of an array.
For example has a storage box.
See if you've got a storage container that has different compartments.
And the first copper compartment you've got maybe close second compartment you've got icecream and so
on the way the compartments are the way you've placed the various object that is the way they are going
to be all that that is worth.
That's what he means by ordered and they order based on numbers and the very first object inside that
container is given an integer indexed of zero.
This second object is given one answer Launce the very first object has an integer indexed value of
zero.
So if you want to reference it you're referencing Phi its index an array can store multiple value objects
as one in comparing two variables than just times once so Larry can store multiple Veau variables has
one value and then three can be identified by square brackets.
When you define an array you have to give it square brackets.
That's the only way Ruby can tell that you are dealing or dealing with an array.
When the re is defined you can have an entity.
I mean you just define it and nothing in there and then later on you can add values to it.
So if you know what your defining ellerey Aina was going to be inside it's best you just add the values
as you create them.
Hillary can also contain a mix of things so you can have an array that has put integer and strings or
just strings or just integers arrays can also have other arrays contained.
Let's create a very simple Hurry.
I'm going to create an I record name right so on calling names.
I'm going to a course to add re.
Because I'm dealing with names.
There is the string so I've got to enclose them in quotes.
I'm going to give the names first name.
I'm going to say Anna
and you separate the values with a comma stuck on them.
See James
third name.
I give you a Lou see.
Third name.
I was saying Andy.
And then I'll close the square brackets so I now have a Larry that has four objects in it and the indexed
is free.
So this first of all have an index integer index of zero.
This will be one two three.
So you can access members of the Arri by their indexed value.
So if I press enter it tells me I have got a low rate of four.
So if I on a list the Arri and just type inputs followed by the name of the Harry which is names.
Press Centre and it'll give me a list.
If I wanted to access an individual member of that array they were I would do that.
I just called the irey by name which is names and the square brackets say I want it to access.
Lucy.
Lucy will be in there X number two.
This is 0 1 2.
I just put 2 in there.
Close the square bracket and press enter.
It would give me the value of Lucy.
Moses got the quotes there because I didn't use it.
Put it fine to put.
Followed by planes and square bracket to give me Lucy without the quotes.
So that's how you access her remember so if you wanted access acts as individual members of an array
you'd do that using it indexed value.
So that's it for this basic introduction to hari's in the Ruby programming language.
Many thanks for watching.
Bye for now.