LinkedList Challenge Solution 3

extension LinkedList {

  mutating func reverse() {

    // 1
    let tmpList = LinkedList<Value>()
    for value in self {
      tmpList.push(value)
    }

    // 2
    head = tmpList.head
  }
}

For the easy way, the let tmpList should be a var right? cause we need to push(value)

I believe this linked list is defined as a reference type so you can use let and still call mutating methods. If you define LinkedList as a value type var would be required here.

I think you are right. The book defines LinkedList as a value type with mutating methods. When I try to run the easy solution in the starter project, I get a compilation error.