Tuples
let raahi = ("Raahi", "Menon", "Grease 2")
// raahi: (String, String, String)Elements
// raahi: { .0: String, .1: String, .2: String }
// = { .0: "Raahi", .1: "Menon", .2: "Grease 2" }
raahi.2
// "Grease 2": Stringraahi.0 = "Rocky"
// raahi: { .0: String, .1: String, .2: String }
// = { .0: "Rocky", .1: "Menon", .2: "Grease 2" }let aBasicTuple = (0, 0)
// aBasicTuple: (Int, Int) = { .0: 0, .1: 0 }
let tupleCopy = aBasicTuple
// tupleCopy: (Int, Int) = { .0: 0, .1: 0 }
aBasicTuple.0 = 1
// aBasicTuple: (Int, Int) = { .0: 1, .1: 0 }
// tupleCopy: (Int, Int) = { .0: 0, .1: 0 }Element Naming
Advanced Tuples
DictionariesLast updated
Was this helpful?