Last active
August 24, 2016 03:25
-
-
Save outsideris/0db7fb07ebd8b6071e73e971b7bcafba to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
function test1() { | |
console.log('-- test1 --'); | |
console.log(x); | |
try { | |
console.log(y); | |
} catch(e) { console.log(e); } | |
var x = 0; | |
let y = 0; | |
} | |
function test2() { | |
console.log('-- test2 --'); | |
foo(); | |
try { | |
bar(); | |
} catch(e) { console.log(e); } | |
try { | |
baz(); | |
} catch(e) { console.log(e); } | |
function foo() { console.log('foo'); } | |
var bar = function() { console.log('bar'); } | |
let baz = function() { console.log('baz'); } | |
} | |
test1(); | |
test2(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- test1 -- | |
undefined | |
[ReferenceError: y is not defined] | |
-- test2 -- | |
foo | |
[TypeError: bar is not a function] | |
[ReferenceError: baz is not defined] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment