switch(result) { case undefined: result = 'ERROR: Calcule is falied!'; break default: if(isNaN(result) ) result = 'ERROR: Answer is not a number!'; } // switch