I currently have a Javascript function that uses a string to reference an object name and acces its properties. I\'m currently using eval() to get the the desired effect whi
Try this instead:
var stringToObjectRef = function() { var myTestObject = { 'item1' : 100, 'item2' : 12, 'item4' : 18 }; var myValue = myTestObject['item1']; alert(myValue); }();