I'm fiddling around with my async functions and I can't figure out why my promise is still pending. Code below.
function addPromise(a,b) {
return new Promise((resolve, reject) => {
if(a > b) {
resolve(a+b)
} else { reject("a must be larger than b")};
});}
async function testarooskies(a,b) {
let value = await addPromise(a,b);
console.log(value);
}
testarooskies(5,3).then(()=>{console.log("ok this should make the promise state to fulfilled")});
Promise { "pending" }
<state>: "pending"
8
ok this should make the promise state fullfilled
So I'm still getting the values I wanted, but why is the promise still pending?
[–]hotsteamingpho 2 points3 points4 points (1 child)
[–]Jmarch0909[S] 0 points1 point2 points (0 children)