How can I update the value in a chaseObj from a method in another object? Any advice would be greatly appreciated. Thank you!
var s, searchUts;
var getValue = '';
var generateObject = function() {
var chaseObj = {
"timeFilters" : getValue
};
return chaseObj;
};
searchUts = s = {
createValue: function() {
var x = 10;
var y = 20;
getValue = x + y; // Add this value to chaseObj inside the generateObject function
},
postToBackEnd: function() {
var chaseObj = generateObj();
$.ajax({
url: localhost:8080/site/home,
data:JSON.stringify(chaseObj) // The chaseObj is not updated with the new value here
})
}
};