Created
November 24, 2017 21:56
-
-
Save sethdavis512/7a8d54605815e2df085f44550a73810d 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
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