Created
December 2, 2016 09:38
-
-
Save prashaantt/396b7d929332a8d7535ed1b0e437e13d 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
let s1: string; | |
s1 = "some string"; | |
s1 = undefined; // Type 'undefined' is not assignable to type 'string' | |
s1 = null; // Type 'null' is not assignable to type 'string' | |
let s2: string | undefined; | |
s2 = "another string"; | |
s2 = undefined; | |
s2 = null; // Type 'null' is not assignable to type 'string | undefined' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment