Angie I.

# I am currently struggling with why not all the curly brackets are closed as shown below

let correctGuess = false;
const number = 6;
const guess = prompt('Guess a number between 1 and 10.');

if ( +guess === number ) {
correctGuess = true;
} else if ( +guess < number ) {
const guessMore = prompt(Try again. The number is higher than ${guess}); if ( +guessMore === number ) { correctGuess = true; } } else if ( +guess > number ) { const guessLess = prompt(Try again. The number is lower than${guess});
if ( +guessLess === number ) {
correctGuess = true;
}
}

if ( correctGuess ) {
console.log("You guessed the number!");
} else {
console.log(Sorry. The number was \${number}.);
}

By:

Tutor
5 (2)

Retired, But Enjoy Passing on Math and Computer Knowledge

## Still looking for help? Get the right answer, fast.

Get a free answer to a quick problem.
Most questions answered within 4 hours.

#### OR

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.