Created
September 19, 2016 05:14
-
-
Save sms-system/4dd885d83e6be4f2f36b37151ab22374 to your computer and use it in GitHub Desktop.
Convert JavaScript string in dot notation into an object reference (http://stackoverflow.com/questions/6393943/convert-javascript-string-in-dot-notation-into-an-object-reference)
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
'a.b.c'.split('.').reduce((o,i)=>o[i], a) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment