Last active
December 3, 2019 19:38
-
-
Save sfelix-martins/71e805dac8a2262321bc0b64dffe20ec to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| // https://stackoverflow.com/a/45322101 | |
| function object_value(key, obj) { | |
| return key.split('.').reduce(function(prev, curr) { | |
| return prev ? prev[curr] : null | |
| }, obj || self) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment