0

I'm doing an ajax call and in the done block I'm appending a value to an object I created outside of the ajax block, but I get the warning when I run this: "Mutable variable is accessible from closure." What does it mean and what am I doing wrong?

The code:

var some_object = { // This is the variable that's "mutable"
    rooms: 4,
    area: 45
};

$.ajax({

}).done(function (data) {
    some_object.value = 10; // The warning appears here, on some_object
});
Weblurk
  • 6,562
  • 18
  • 64
  • 120

0 Answers0