Cleanup code to handle infinity error rate

Currently the JavaScript code in tutor.js does not set the
errorRate property in the global my object to infinity when the
user makes errors without typing any correct characters.
Instead, while displaying the error rate to the user, the
errorRate property is ignored if the user makes errors without
typing any characters correctly, and infinity is displayed as
the error rate. As a result, the code that displays the error
rate is a little confusing.

Write this code in a neater way by setting the errorRate
property to Number.POSITIVE_INFINITY when required. Accordingly,
simplify the code that displays the error rate to the user to
display an error rate of infinity when the errorRate property is
set to Number.POSITIVE_INFINITY.