Useful Methods
suggest changeDetermine whether an array is empty, or return its size:
var exampleArray = [1,2,3,4,5]
exampleArray.isEmpty //false
exampleArray.count //5
Reverse an array. reversed() returns a new array, so assign the result if you want to keep it. reverse() mutates the array in place.
exampleArray = exampleArray.reversed()
// exampleArray = [5, 4, 3, 2, 1]
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents