Mastering macOS Programming
上QQ阅读APP看书,第一时间看更新

Mutating non-returning methods

The following methods do not return the removed elements:

arr.removeLast(2) 
arr.removeFirst(3)
arr.removeAll()

It's particularly confusing that the methods removeFirst and removeLast behave differently depending on whether an Int argument is supplied, so watch out for that one.