Watchara
0
Q:

get last element of array swift

if let last = a.last {
   print(last)
}
1
let array = ["A", "B", "C", 1, 2, 3]
let size = array.count
last_element = array[size-1]
print(last_element)
0

New to Communities?

Join the community