done or success for $.each

done or success for $.each


Hi,

Why I am getting:

Error: 'Uncaught TypeError: $.each(...).promise is not a function', line 132, file 'http://localhost:53470/views/signin.js'.


  1. $.each(data, function (index, item) {
  2.     -------- run some code here
  3.     -------------
  4.     ------------
  5. }).promise().done(function () {
  6.     alert("All was done");
  7. });

Isn't there any done or success for the $.each?

kindly advise how to achieve done or success for $.each


Thanks,