A defer statement can be useful to change state once a function's execution is complete, or to clean up values that are no longer needed. Let's look at an example of updating state with a defer statement.
Imagine that we have movie reviews with star ratings, and we want to classify them based on their star rating.