how to delete a particular json element by variable:
i.e. I want to delete obj.a.b, but it is passed by a variable.
Is there a simple way to implement this?
var t = 'obj.a.b';
var obj = {a: {b: 'b', b2: 'b2'}};
delete t; // not work here
console.log(JSON.stringify(obj));