Chad 01 July 2014 Sure, this is wrong: var propertyName = ‘myProperty’; eval(‘object.’ + propertyName); ——- but what about this? var propertyName = ‘myChildObject.myProperty’ eval(‘object.’ + propertyName); ? How else would I get to myProperty if all I have is the string, and the data is inside of the local var ‘object’?
Sure, this is wrong:
var propertyName = ‘myProperty’;
eval(‘object.’ + propertyName); ——- but what about this?
var propertyName = ‘myChildObject.myProperty’
eval(‘object.’ + propertyName); ?
How else would I get to myProperty if all I have is the string, and the data is inside of the local var ‘object’?