I have an array, I need to recompile with the use of some edits. I do it with the help of async.concat(), but something is not working.
Tell me, where is the mistake?
async.concat(dialogs, function(dialog, callback) {
if (dialog['viewer']['user_profile_image'] != null) {
fs.exists(IM.pathToUserImage + dialog['viewer']['user_profile_image'].replace('%s', ''), function(exits) {
if (exits) {
dialog['viewer']['user_profile_image'] = dialog['viewer']['user_profile_image'].replace('%s', '');
}
callback(dialog);
});
}
}, function() {
console.log(arguments);
});
In my opinion, everything is logical. callback is invoked immediately after the first iteration. But how can I send the data after the completion of processing the entire array?
Thank you!
console.logcall log? What's unexpected with the result?callbackinstead.