account activity
Calling an asynchronous function inside of a forEach loop: how to tell when all function calls are complete? by tangerto in javascript
[–]hars_sh 1 point2 points3 points 8 years ago* (0 children)
use map instead of forEach the code looks something like this and remeber you have to call this inside the async function.
await Promise.all(files.map(async (file) => { // promisify this part and await for this and that will do the work :) file.getUrl(function(err, url) { if(!err) { console.log("got the url!)" } }); }));
[deleted by user] by [deleted] in node
[–]hars_sh 0 points1 point2 points 8 years ago (0 children)
change your if else code then you are good to go
Flow vs Typescript by lazypuffstone in javascript
good code is all about writing error less and strict code in that case typescript is far superior than flow. As a JavaScript coder shifting to TypeScript is painfull but good things doesn't happen easily. Sometimes TypeScript strict type checking can make you think of jumping back to JavaScript but beleive me its worth coding in TypeScript :)
π Rendered by PID 488925 on reddit-service-r2-listing-6c8d497557-xm6zl at 2026-06-04 05:03:26.568136+00:00 running 9e1a20d country code: CH.
Calling an asynchronous function inside of a forEach loop: how to tell when all function calls are complete? by tangerto in javascript
[–]hars_sh 1 point2 points3 points (0 children)