Skip to content

Instantly share code, notes, and snippets.

@simondell
Created April 11, 2017 10:07
Show Gist options
  • Save simondell/ed756be7de0c7591cd3569f278fed975 to your computer and use it in GitHub Desktop.
Save simondell/ed756be7de0c7591cd3569f278fed975 to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/howufam
<!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">
'use strict';
try {
var _t = 't shouldn\'t be available in the catch or finally blocks';
throw _t;
} catch (error) {
console.log('Here\'s the catch: ' + t);
console.log(error);
} finally {
console.log(t);
}
</script>
<script id="jsbin-source-javascript" type="text/javascript">try {
let t = 't shouldn\'t be available in the catch or finally blocks';
throw t;
} catch ( error ) {
console.log(`Here's the catch: ${t}`);
console.log(error);
} finally {
console.log(t);
}</script></body>
</html>
'use strict';
try {
var _t = 't shouldn\'t be available in the catch or finally blocks';
throw _t;
} catch (error) {
console.log('Here\'s the catch: ' + t);
console.log(error);
} finally {
console.log(t);
}
@simondell
Copy link
Author

This made a lot more sense in the original ES6 dialect. Probably best you view it on JSBin rather than here. Sorry for the inconvenience.

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