function calculation() {
var firstNum = prompt('Enter first number:'),
secondNum = prompt('Enter second number:'),
operating = prompt('Enter operating with number:'),
result = /[+*\/-]/.test(operating) ? eval(+firstNum + operating + +secondNum) : 'ERROR: ' + {'': 'Values are empty!', NaN: 'Answer is not a number!'}[operating] || 'Calcule is falied!';
alert(result);
};
calculation();