We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Promise 是一个对象,它可能在未来某个时间产生单个值,具有已解决的值或未解决的原因(例如,网络错误)。它将处于 3 种可能的状态之一:已完成、已拒绝或待处理。
Promise 创建的语法如下所示,
const promise = new Promise(function (resolve, reject) { // promise description });
承诺的用法如下,
const promise = new Promise( (resolve) => { setTimeout(() => { resolve("I'm a Promise!"); }, 5000); }, (reject) => {} ); promise.then((value) => console.log(value));
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Promise 是一个对象,它可能在未来某个时间产生单个值,具有已解决的值或未解决的原因(例如,网络错误)。它将处于 3 种可能的状态之一:已完成、已拒绝或待处理。
Promise 创建的语法如下所示,
承诺的用法如下,
The text was updated successfully, but these errors were encountered: