Beginner Swift
Q13 / 100

What does the mutating keyword mean on a struct method?

Correct! Well done.

Incorrect.

The correct answer is B) The method is allowed to modify the struct's stored properties

B

Correct Answer

The method is allowed to modify the struct's stored properties

Explanation

Structs are value types, so by default methods cannot modify self. mutating func allows property changes inside the method.

Progress
13/100