From 1c226cec68d71113ca499f5446f53f6c6b3bcdf6 Mon Sep 17 00:00:00 2001 From: Rohit Paul <113459757+RohitPaul12345@users.noreply.github.com> Date: Wed, 9 Aug 2023 20:36:09 +0530 Subject: [PATCH] Update index.js --- index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/index.js b/index.js index ad0c2c4..40720e3 100644 --- a/index.js +++ b/index.js @@ -1,17 +1,17 @@ -var guess = Math.floor(Math.random() * 101) -var chances = 0; +let guess = Math.floor(Math.random() * 101) +let chances = 0; -var k = prompt(`guess the number from 0-100, chances are ${chances}`) +let k = prompt(`guess the number from 0-100, chances are ${chances}`) while (k != guess) { chances++; if (k < guess) { console.log("k is less than guess") - var k = prompt(`guess the number from 0-100, chances are ${chances}`) + let k = prompt(`guess the number from 0-100, chances are ${chances}`) } else { console.log("k is greater than guess") - var k = prompt(`guess the number from 0-100, chances are ${chances}`) + let k = prompt(`guess the number from 0-100, chances are ${chances}`) } } if (k == guess) {