function ajax_call() {
var ajaxCallMock = $.Deferred().resolve('A');
return ajaxCallMock.done(function(response) {
return 'B';
});
}
ajax_call().done(function(response) {
console.log(response);
});
I would expect the console output to be 'B', but I get 'A'. Why?
donepart, sorry.done()is not a synonym for.then(). There are few if any cases where you would use.done().