Language Basics JavaScript DHTML



    Confirming Something
    
    
    
    function processConfirm(answer) {
  var result = "";
        if (answer) {
            result = "Yes";
        } else {
            result = "No";
        }
        return result;
    }
    



var confirmAnswer = confirm("Yes or no?");
var theAnswer = processConfirm(confirmAnswer);
document.write(theAnswer);