Errata: p.32 (inconsistent declaration)

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]

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”:

let countingDown = countingUp.reverse()

Thus, countingUp should be declared using ‘var’ back on page 32.

Thank you for posting this; it will be added to the errata.