function downloadPromise() {
return new Promise(function (resolve, reject) {
console.log("Starting to download the file")
setTimeout(function () {
console.log("Download is Complete");
resolve();
}, 3000)
})
}
var downloadedFile = downloadPromise()
setTimeout(function () {
downloadedFile.then(function () {
console.log("After Download")
})
}, 4000)
This is the code that I am running on VS Code and this error often pops up.