Swift BasicsLesson 13Free preview
Swift Arrays
This lesson is part of Swift · All levels
Summary
This lesson discusses the Array in Swift which is a collection of elements sorted by a uniform data type. The array in Swift is a flexible and dynamic value type. Developers will learn the operations of array making, adding elements with append(), removing elements, as well as zero-based indexing.
Key points
- The array keeps a set of values of the same type in sequence
- Made with the shorthand syntax: '[Type]()' or '[element1, element2]'
- The array index starts with a number of 0.
- The '.append()' method adds new elements to the end of the array
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.