0
i got error
var prom = function () { return new Promise((resolve, reject) => { setTimeout(() => { resolve("29383") reject("86565") }, 1000); }) } Promise.all([prom()]).then((result)=>{return result[0]}).then((Number(result1))=>{ console.log(result1+23) })
2 odpowiedzi
+ 1
It isn't able to convert result1 to Number . Maybe because it is just a parameter and you can't operate on it that way !!
Convert result1 to number inside function. You can use +result1 to convert to int as well.
0
Missing parenthesis after the closing of setTimeout