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 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…