My code works fine, my question is, is my code good example for the work environment? Thank you!
(function() {
function makeQuestion() {
var num1 = Math.floor(Math.random() * 11);
var num2 = Math.floor(Math.random() * 11);
var result = num1 * num2;
function askQuestion() {
var answer = prompt(num1 + " * " + num2 + " = ").toLowerCase();
if (answer !== 'exit') {
if (answer == result) {
alert("correct");
makequestion();
} else {
alert("wrong");
makequestion();
}
}
}
askQuestion();
}
makeQuestion();
})();
Aucun commentaire:
Enregistrer un commentaire