Answers for "swift initialize array"

3

swift append to array

var numbers = [1, 2, 3, 4, 5]
numbers.append(100)
print(numbers)
// Prints "[1, 2, 3, 4, 5, 100]"
Posted by: Guest on November-08-2019
0

swift initialize array with size

let myArraySize: Int = 42
let myArray: [Int] = [Int](repeating: 0, count: myArraySize)
Posted by: Guest on March-11-2020

Code answers related to "Swift"

Browse Popular Code Answers by Language