4 Answers
New AnswerI want to make the user guess one of two numbers and I will let him try only three times, my array contain 6 numbers and I'm using (do , while)
1/2/2021 12:38:10 PM
Odai Qudah4 Answers
New AnswerOdai Qudah before we can help you, you should show us your attempt first. if you have not done a try by yourself upto now, please do so. Put your code in playground and link it here. without having seen your code, you can only get a hint of how it could be done: ▪︎ use a loop with a counter variable that will be decremented in each iteration. this variable can be checked with s conditional expression e.g. if..., Thanks!
var me = '3'; var tryGuess = ['1', '3','5','7']; do{ tryGuess = prompt('how many times i tryied to fix this assignment?from 1 to 10'); me <= 4; }while(tryGuess !== me){ alert("correct"); } console.log(tryGuess);
SoloLearn Inc.
4 Embarcadero Center, Suite 1455Send us a message