In the following examples, focus on the variable ‘countingUp’.
On page 32, the second example from the bottom shows (with emphasis as shown in the book):
let countingUp = [“one”, “two”]
let nameByParkingSpace = [13: “Alice”, 27: “Bob”]
Page 34 shows (in the middle of the page, under “Properties”):
var countingUp = [“one”, “two”]
let secondElement = countingUp[1]
countingUp.count
Note how countingUp was changed from ‘let’ to ‘var’. That code still works with ‘let’, but it bites us in the following section, same page, under “Instance Methods”:
countingUp.append(“three”)
let countingDown = countingUp.reverse()
Thus, countingUp should be declared using ‘var’ back on page 32.