Skip to content

Instantly share code, notes, and snippets.

@Magvin
Created July 19, 2019 20:19
Show Gist options
  • Save Magvin/18c9cdd3d1bc6d9c4c87d7908ec94635 to your computer and use it in GitHub Desktop.
Save Magvin/18c9cdd3d1bc6d9c4c87d7908ec94635 to your computer and use it in GitHub Desktop.
Promise script
function scrapp(promise, i) {
return new Promise((resolve, reject) => {
promise.then(res => {
resolve(res);
if (i <= hardCoded) {
scrapp(scrappCars(i), i + 1).then(res => {
if (i >= hardCoded) {
console.log(Object.keys(newCollectionMap).length);
// compareVehicleCollection();
}
});
}
});
});
}
scrapp(scrappCars(itteration), itteration + 1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment