Может так?
function calc() {
    const menu = prompt("Калькулятор: 1) сложение, 2) вычитание, 3)умножение, 4) деление");
    const a = prompt("a");
    const b = prompt("b");
    const operation = [false, '+', '-', '*', '/'][menu] || false;
    if (!operation)
        return alert('Wrong operation');
    return eval(a + ' ' + operation + ' ' + b + ';');
};
alert(calc());