Created
July 28, 2011 19:48
-
-
Save nathansearles/1112383 to your computer and use it in GitHub Desktop.
Return variable from string
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
var someString = "someArray"; | |
$.someArray = | |
[ | |
'Item One', | |
'Item Two', | |
'Item Three', | |
'Item Four', | |
'Item Five', | |
'Item Six' | |
]; | |
$.someOtherArray = | |
[ | |
'Other Item One', | |
'Other Item Two', | |
'Other Item Three', | |
'Other Item Four', | |
'Other Item Five', | |
'Other Item Six' | |
]; | |
console.log($[someString]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment