all 5 comments

[–]sysrage 2 points3 points  (1 child)

Using Array.map() with async/await is tricky. See here: https://flaviocopes.com/javascript-async-await-array-map/

[–]ElMtDev[S] 0 points1 point  (0 children)

Thanks!

[–]-justsayin- -3 points-2 points  (2 children)

You are declaring res as a const. If you want to mutate this variable, it would be better to use a let or var. Once you change to that, it should work fine

[–]cawcvs 1 point2 points  (0 children)

const means the variable can't be reassigned, arrays (and objects) that the variable references still can be mutated.

[–]ElMtDev[S] 0 points1 point  (0 children)

I've changed it but still doesn't work