filmov
tv
Introduction to Swift 9 - Arrays & Dictionaries

Показать описание
Today we covered Arrays and Dictionaries.
We explained what an array is, how to insert an item to an array, print values at specific indexes, search an array for a word, and loop through an array.
We also discussed what a dictionary is, as well as the differences between an array and a dictionary. We learned how to update an existing value, add a new value, and also loop through a dictionary to get the keys and values.
In order to test out your knowledge on Arrays and Dictionaries, consider creating a dictionary of type [String: [String]] to hold names of people (as the keys), and an array of children (as the values).
Whenever we want to see all the children that a person has, we should be able to do... people["emmanuel"], and get a response like ["Nduka", "Ihemjiere", "Grace"].
We explained what an array is, how to insert an item to an array, print values at specific indexes, search an array for a word, and loop through an array.
We also discussed what a dictionary is, as well as the differences between an array and a dictionary. We learned how to update an existing value, add a new value, and also loop through a dictionary to get the keys and values.
In order to test out your knowledge on Arrays and Dictionaries, consider creating a dictionary of type [String: [String]] to hold names of people (as the keys), and an array of children (as the values).
Whenever we want to see all the children that a person has, we should be able to do... people["emmanuel"], and get a response like ["Nduka", "Ihemjiere", "Grace"].