Guess | Sololearn: Learn to code for FREE!



How do I restrict the number of guesses user has to guess a word in JavaScript

4/22/2018 3:59:31 PM


2 Answers

New Answer


I would advise the same logic as Adam did (though I reversed it to track remaining instead of the current guess number). See the code:


set up a counter. and every time they guess increment it by 1. check if counter < limit.