Check out example codes for "swift initialize array with size". It will help you in understanding the concepts better.

Code Example 1

let myArraySize: Int = 42
let myArray: [Int] = [Int](repeating: 0, count: myArraySize)

Learn ReactJs, React Native from akashmittal.com