Un programa que presente un menú con: suma, resta, multiplicar, dividir y salir
Script function add(a, b){ return a + b; } function substract(a, b){ return a - b; } function multiply(a, b){ return a * b; } function divide(a, b){ return a / b; } function choice(){ var choice = prompt("What do you want to do? \n\n 1. Add \n\n 2. Substract \n\n 3. Multiply \n\n 4. Divide \n\n 5. Exit") var a = parseInt(prompt("Enter the first number")); var b = parseInt(prompt("Enter the second number")); if(choice === "1"){ alert(add(a, b)); }else if(choice === "2"){ alert(substract(a, b)); }else if(choice === "3"){ alert(multiply(a, b)); }else if(choice === "4"){ alert(divide