how to get. last element of an arry. swift code example Example: how to get the last element of an array in swift if let last = a.last { print(last) }