Created
July 19, 2019 20:19
-
-
Save Magvin/18c9cdd3d1bc6d9c4c87d7908ec94635 to your computer and use it in GitHub Desktop.
Promise script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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