Code explanation on jQuery Deferred and async ops