How can I write the following code better stronger and sexier? To me it feels icky using the eval function.
var bagData = {
"beach" : {
"ratio" : [4,3]
},
"bucket" : {
"ratio" : [5, 3]
}
};
bagType = "bucket";
ratio = eval("bagData." + bagType + ".ratio");