Useful Methods

suggest change

Determine 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]

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents