Skip to content

Commit

Permalink
Merge branch 'apatronl-patch-1' of git://github.com/apatronl/swift-su…
Browse files Browse the repository at this point in the history
…mmary into apatronl-apatronl-patch-1
  • Loading branch information
Juan Antonio Karmy committed Oct 23, 2016
2 parents fd439c9 + b7ae78f commit 5a2d823
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ shoppingList.insert("Maple Syrup", at: 0) //Inserts element at index

let mapleSyrup = shoppingList.remove(at: 0) // Returns removed item

var emptyArray = [Int]() //Initialize empty array
var anotherEmptyArray = [] //Also valid
var emptyArray = [Int]() //Initialize empty array, type of elements must be provided
var anotherEmptyArray: [Int] = [] // Also valid
var someArray = ["Hello", "World"]
someArray = [] // This is valid when the context already provides type information
var array = [Int](repeating: 0, count: 3) //Initalizes an array of length 3 with zeros

var compoundArray = array + emptyArray
Expand Down

0 comments on commit 5a2d823

Please sign in to comment.