It might be a bit much to expect the reader to evaluate the two options presented here.  I'm not sure why we'd show them how to avoid the getGrade function and use the state directly.