Pop Last Element Array Swift
// Initialize the Array
var a = [1,2,3]
// Remove last item
let lastItem = a.removeLast()
print(lastItem)
print(a)
Mobile Star
// Initialize the Array
var a = [1,2,3]
// Remove last item
let lastItem = a.removeLast()
print(lastItem)
print(a)
var x = [2, 4, 6, 7]
x.popLast()
print(x.count)
// output : 3