var give = \'i.want.it\'; var obj = { i: { want: { it: \'Oh I know you do...\' } } }; console.log(obj[give]); // \'Oh I know yo
You can use eval()
var obj = {"a": { "b": { "c": 3}}}; writeln(eval('obj.a.b.c') + 2);
This will output 5.
JavaScript is weakly typed and thus it's evaluation function executes a statement as well as evaluating an expression.