Recursive $.extend upon function call.
I want to recursively update the json file I have whenever I call a function.
//Call up a function when hovered onto a selected html element.
var i=0, j=1
function updateJSON(){
// Update the variables
i++; j++
jdat = {"val":{"a":i, "b", j}}
jdat = $.extend({jdat}, {});
}
//Call the function three times, I should see this,
updateJSON() // x3 times called
output : {"val":{"a":1, "b":2}, "val":{"a":2, "b":3}, "val":{"a":3, "b":4} } // This doesn't happen, how can I do it?