Hello and welcome to the goal and programming language course in the previous session, we talked about
creating and initializing a map variation by the make function and indecision decision.
We want to talk about the other maps concept.
Map links to determine how many items key value pairs a map has use built in land function.
Now you can see the sample go to this school to illustrate how to use built in land function.
For the example, creating a map using make function twist or employees marks and sit astride times
as index and sit in type as value, vash and fluid equals make function math.
This global markets sit history as index and sit end as value.
Now go to the next line and initialize the Mac and Louis index, for example, keen and value is 10.
Go to the next line, and Louis, he is gene values 20.
And in the next line and another element employee.
Rather.
And value is 30.
And create a game empty map.
Go to the next line and Chloe
Beast.
Colin Equals make and map key is strange, and when is it now, Yvonne, to see length of to my variable
by the land function, first variable initialize and second variable don't initialize.
Go to the next line FP lend function for the employee and go to the next line if the using land function
for the employee list.
Reformat the code, save the project and execute the program.
Now we can see the output for employment, the length is three because it has three values and for the
employee list, the length is zero because it doesn't have any value and the learned function in return
zero for an undisclosed month.
Now go to his line and continue.
Accessing items, you can access the items of a map by referring to its key name inside Esquire brackets.
Now you can see the sandpit.
Go to this school to illustrate how to access map items.
First, clear the last quote.
Save the project, for the example, creating a map twist to a person's idea and sit and type as index
and string type as a value vase in pillowy equals map type index is in and value index is a string and
initialize the variable.
For the example, a hundred other
key and 200 dollar value is gene.
And third element 300, Colin, and value is rather diplomatic coup and go to the next line.
Now you access the map items by calling in the Esquire brackets.
So do the following if he
said name of map and put the selected index in square brackets for the example employee escort brackets
and set the index for the Example 100, reformat the code and save the project, then execute the program.
Now we can see the output.
We put an index in square brackets and get the value of that index.
In this case, we set the hundred as index and the return chain as value.
Now we could define the map and access to its items in order not to prolong the time of decision will
finish it, and we will continue the content in the next session.
Goodbye.