Arrays Flashcards

1
Q

How do you declare an Array?

A

With Square-Brackets

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How do you find out how many items are in an Array?

A

[“nameOfArray”].count

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How do you append an Element to an exsisting Array?

A

[“nameOfTheArray”].append()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How do you remove the last Element of an Array?

A

array.removeLast()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How do you sort the Elements of an Array?

A

array.sort()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How do you remove an Element of an Array at a specific Index?

A

array.removeAtIndex()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How do you remove the first Element of an Array?

A

array.removeFirst()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How do you remove all Elements of an Array?

A

array.removeAll()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is a Dictionary?

A

A dictionary stores associations between keys of the same type and values of the same type in a collection with no defined ordering

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How do you create a Dictionary?

A

[“key_Name”:”key_Value”]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How do you access the Value of an Element in the dictionary?

A

[nameOfDictionary][“key_Name”]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How do you count the Elements of a Dictionary?

A

[dictionary_Name].count

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How do you append an Element to a Dictionary?

A

[dictionary_Name][“key_Name”] = [“key_Value”]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How do you remove an Elemt of a Dictionary?

A

[dictionary_Name].removeValueForKey(“[key_Name]”)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly