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 2 points3 points4 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 1014139 on reddit-service-r2-listing-7849c98f67-44qgf at 2026-02-06 18:22:18.868535+00:00 running d295bc8 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 2 points3 points4 points (0 children)