-
promise |
Beta Was this translation helpful? Give feedback.
Answered by
hixb
Jul 13, 2022
Replies: 1 comment
-
` promise |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
xiao-ice
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
`
const promise = new Promise((resolve, reject) => {
resolve("success1");
reject("fail");
resolve("success2");
});
promise
.then(res => {
console.log("then: ", res);
}).catch(err => {
console.log("catch: ", err);
})
`