i have a object, which is getting passed in many different functions inside a function. these functions may or may not change the value of the object, but if they do change it, then i would like to get the latest changes on object.
following is what im trying to do:
var ob = {text: 'this is me', name: 'john'}
function (object) {
changeObject(object);
customObjectChanger(object);
callback = function (object) {
object.text = 'new text';
}
callback(object);
// object value here should be object{text: 'new text', name: 'john'};
}
Question&Answers:os