Skip to content

Instantly share code, notes, and snippets.

@sethdavis512
Created November 24, 2017 21:56
Embed
What would you like to do?
function getSafe(fn) {
try {
return fn();
} catch (e) {
return undefined;
}
}
getSafe(() => obj.a.lot.of.properties);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment