Creating and Mutating Arrays
Array literals, append, insert, remove and index-based access patterns.
Welcome
Arrays are ordered collections of values of the same type. Swift arrays are powerful, safe, and highly optimised. Let's master creation, mutation, and access.
Creating Arrays
```swift
let empty: [Int] = []
let nums = [1, 2, 3, 4, 5]
var repeated = Array(repeating: 0, count: 5) // [0,0,0,0,0]
var range = Array(1...5) // [1,2,3,4,5]
```
All lessons in this course
- Creating and Mutating Arrays
- Sorting, Searching and Slicing
- Map, Filter and Reduce on Arrays
- 2D Arrays and Nested Collections