a) What’s wrong with a simple a.b[0].c=”After”?
As for the method:
function setToValue(obj, value, path) {
var i;
path = path.split('.');
for (i = 0; i < path.length - 1; i++)
obj = obj[path[i]];
obj[path[i]] = value;
}
Here the JSFiddle: http://jsfiddle.net/QycBz/24/