<!DOCTYPE html>
<html>
<head><title>Usando Funções internas</title>
</head>
<body>
<h2> Exemplo1</h2>
<script>
try{
var x=a;
var b= x+10;
alert(b);
}
catch (e){
alert(e.toString());}
finally{
document.write("Fim");}
</script>
<hr/>
<h2> Exemplo2</h2>
<script>
var x = prompt("Informe o valor maior que 10");
try{
if (x<10){
throw "Numero menor que 10";}
alert(x);
}
catch (e){
alert(e);}
finally{
document.write("Fim");}
</script>
<hr/>
</body>
</html>
---------------------------------------------------------------------
Nenhum comentário:
Postar um comentário