var myString = "x",
myObject = {
x: 10
},
value = eval("myObject." + myString);
alert(value)
alert(myObject[myString]);
I have been reading about eval() function over the internet, but could not really grasp on what it actually does apart from "It Evaluates an expression".
Should we use eval() function only for numeric values?.