Could someone tell me how I can implement true or false statements if the calculation is right orwrong. I’m trying to create a calculator with a prompt which asks you for a certain calculation if the calculation is right a true statement should pop up if wrong a false statement should pop. It would also help me if someone has an idea on what I should code to make the prompt only poping up if the previous calculation is finished and you can see if the calculation is right or wrong not right after I typed in the result into the promp( newbie from germany)
var number = prompt("what is 1 + 1")
document.getElementById("taschenRechner").innerHTML = number
function rechnen () {
if (prompt === 2) {
return true
}
return false
}
var number = prompt("what is 1 + 2")
document.getElementById("taschenRechner2").innerHTML = number
function rechnen () {
if (prompt === 3) {
return true
}
return false
}
var number = prompt("what is 1 + 3")
document.getElementById("taschenRechner3").innerHTML = number
function rechnen () {
if (prompt === 2) {
return true
}
return false
}
var number = prompt("what is 1 + 4")
document.getElementById("taschenRechner4").innerHTML = number
function rechnen () {
if (prompt === 2) {
return true
}
return false
}