Guess the Number Game in JavaScript

Original Code

Converted Code