Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function check(idx, isLast) {
- return function(err, res) {
- //some logic here
- if(isLast) { done(); }
- };
- }
- for (var idx=0; idx<array.length; idx++) {
- somefunction(check(idx, idx === array.length - 1));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement