Skip to content

Instantly share code, notes, and snippets.



Last active Feb 5, 2020
What would you like to do?
Gists for Medium Post
type SomeObjectType = {
id: number;
text: string;
let someObject: SomeObjectType | undefined;
if (someObject && Object.keys(someObject).length > 0) {
//This evaluates as truthy because it's not undefined = 12; //TS compiler doesn't complain here because the object exists
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.