- Mastering macOS Programming
- Stuart Grimshaw
- 40字
- 2025-04-04 19:10:25
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.