0Pricing
Swift Academy · Lesson

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

  1. Creating and Mutating Arrays
  2. Sorting, Searching and Slicing
  3. Map, Filter and Reduce on Arrays
  4. 2D Arrays and Nested Collections
← Back to Swift Academy