Arrays & Sets
Learn how to use Swift arrays and sets to keep your data organized.
StartKey Concepts
Review core concepts you need to learn to master this subject
Array
Initialize with Array Literal
Index
.count
Property
.append()
Method and +=
Operator
.insert()
and .remove()
Methods
Iterating Over an Array
Swift Sets
Array
Array
var scores = [Int]()
// The array is empty: []
An array stores an ordered collection of values of the same data type.
Use the initializer syntax, [Type]()
, to create an empty array of a certain type.
Arrays
Lesson 1 of 2
What you'll create
Portfolio projects that showcase your new skills
How you'll master it
Stress-test your knowledge with quizzes that help commit syntax to memory