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
const fn = () => new Promise((resolve, reject) => { console.log(1); resolve("success"); }); console.log("start"); fn().then(res => { console.log(res); }); // start, 1, success
start
1
fn
new Promise()
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Promise 题目 1 - 6
过程分析
start
就在1
之前打印出来了,因为fn
函数是之后执行的.new Promise()
就执行它的第一个参数函数了, 其实这是不对的, 就像这两道题中, 我们得注意它是不是被包裹在函数当中, 如果是的话, 只有在函数调用的时候才会执行.The text was updated successfully, but these errors were encountered: