If set of operations to be applied to all elements of the array, it is possible to replace for-loop with forEach{} closure and use optional chaining:
var arr: [Int]? = [1, 2, 3]
arr?.forEach{print($0)}
If set of operations to be applied to all elements of the array, it is possible to replace for-loop with forEach{} closure and use optional chaining:
var arr: [Int]? = [1, 2, 3]
arr?.forEach{print($0)}