Saturday, 9 February 2019

Restructure this without Function in Loop

I got an error based on this code asking me not to put a function in a loop. Any suggestions?var done = 0;for(var i = 0; i < products.length; i++) {products\[i\].save(function(err, result) { done++; if(done === products.length) { exit(); } }); }

Submitted February 09, 2019 at 07:44AM by nprmass

No comments:

Post a Comment