javascript复习1:基础
function th(){var x=prompt("Enter a number between 0 and 10:","")try{ if(x>10) throw "Err1"else if(x<3)throw "Err2"} catch(er){if(er=="Err1") alert("Error! The value is too high")if(er == "Err2") alert("Error! The value is too low") }}