You want to update your method signature to accept the: object you're modifying, the path string, and the value you're assigning to the final path property.
function updateObject(data, path, value) {
var pathArray = path.split(">");
var pointer = data; // points to the current nested object
for (var i = 0, len = pathArray.length; i < len; i++) {
var path = pathArray[i];
if (pointer.hasOwnProperty(path)) {
if (i === len - 1) { // terminating condition
pointer[path] = value;
} else {
pointer = pointer[path];
}
} else {
// throw error or terminate. The path is incorrect
}
}
}
Or recurse. Or use a while loop. But this is the general idea.
Fiddle: http://jsfiddle.net/Sq8j3/8/