Last active
May 18, 2016 11:45
-
-
Save jeffmo/528ba625bd3c69adcd88cabfae1564a9 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
let foo: ?number; | |
function bar() { | |
if (foo == null) { | |
return; | |
} | |
setTimeout(() => { | |
// I refined above, so this should work right? | |
// (hint: wrong. If `foo` were const, then it would be a correct/more intuitive assumption) | |
let someNum: number = foo; | |
}, offset); | |
} | |
// ...in a galaxy far far away... | |
foo = null; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment