code is as follows, but not all of it is posted, because it is too long and miscellaneous:
//123
let answer = 0;
do{
defaultPage();
answer = require("readline-sync").question();
if(answer == 1){
return action1(input);
}else if(answer == 2){
return action2(input);
}else if(answer == 3){
return "";
}else{
return "Bad choice, please choose again!"
}
}while(answer == 1)
}
the running result is as follows: