Couldn't we just use ```messages.length > 0``` instead of introducing a new variable?

Also, I don't see hasMessages defined anywhere.