Given the following object:
var obj = { a: 1 };
and the following string:
var s = "b: 2";
what I need is to end with the following object, after evaluating the string s:
obj === { a:1, b:2 }
I tried with eval
but couldn't figure it out. any ideas?