Number Guessing game in JavaScript