Skip to content

Instantly share code, notes, and snippets.

Created April 29, 2016 00:22
Show Gist options
  • Save anonymous/3cb31d1f8af387b09e53e02e4e49fb50 to your computer and use it in GitHub Desktop.
Save anonymous/3cb31d1f8af387b09e53e02e4e49fb50 to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/cilure
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
try{
console.log('here i try');
// throw new RangeError("RangeError");
// nest try
try{
throw new TypeError("Inner error");
}
catch(e){
console.error('catched inside: ' + e.message);
throw e; //向外层抛出
}
finally{
console.log("Inner finally");
}
}
catch(e){
console.error('catched outside: '+ e.message);
}
finally{
console.log("finally");
}
</script>
<script id="jsbin-source-javascript" type="text/javascript">try{
console.log('here i try');
// throw new RangeError("RangeError");
// nest try
try{
throw new TypeError("Inner error");
}
catch(e){
console.error('catched inside: ' + e.message);
throw e; //向外层抛出
}
finally{
console.log("Inner finally");
}
}
catch(e){
console.error('catched outside: '+ e.message);
}
finally{
console.log("finally");
}</script></body>
</html>
try{
console.log('here i try');
// throw new RangeError("RangeError");
// nest try
try{
throw new TypeError("Inner error");
}
catch(e){
console.error('catched inside: ' + e.message);
throw e; //向外层抛出
}
finally{
console.log("Inner finally");
}
}
catch(e){
console.error('catched outside: '+ e.message);
}
finally{
console.log("finally");
}
@mactive
Copy link

mactive commented Apr 29, 2016

here i try throw in js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment