InitializerSwift

init()

Creates a new, empty array.

init()

Overview

This is equivalent to initializing with an empty array literal. For example:

var emptyArray = Array<Int>()
print(emptyArray.isEmpty)
// Prints "true"

emptyArray = []
print(emptyArray.isEmpty)
// Prints "true"