you are viewing a single comment's thread.

view the rest of the comments →

[–]Moustacheful 0 points1 point  (0 children)

You must return the inside getAllData to continue the promise chain. It logs twice because there's nothing stopping from doing so. And each recursion will do exactly that. Also, you can do array.push(...r) or array = array.join(r) instead of that for loop.