I'm creating a Simon Says game where the pattern gets progressively longer as the user gets the pattern correct, but the input history shows their previous pattern inputs. How do I clear this history?
This code is on the CodeHS site. I've researched and tried console.clear();, clear(); and console.API.clear();, but it just doesn't seem to work.
Here is the section of my code that gets the user's input.
//green red blue yellow
var generatedPattern = "grby"
function getUserInput(){
/*User input of the last round gets saved which shows them 'grb', allowing
the user to look back at their previous guess to easily guess the
next pattern*/
guess = readLine("Input guess here: (example: ybbg)");
if(guess == generatedPattern){
return true;
}else{
return false;
}
}
I expect the log to be cleared with clear(); or console.clear();, but it doesn't do anything.