Created
March 29, 2017 18:11
-
-
Save okeydoke/54185eb852c88d807b9dfc076e9a802a to your computer and use it in GitHub Desktop.
idx
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
idx = (p, o) => p.replace(/\[/g,'.').replace(/\]/g, '').split('.').reduce((xs, x) => (typeof xs !== 'undefined' && typeof xs[x] !== 'undefined') ? xs[x] : undefined, o) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment