Skip to content
New issue

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

面试题2(day1) #2

Open
robbiemie opened this issue Feb 27, 2024 · 0 comments
Open

面试题2(day1) #2

robbiemie opened this issue Feb 27, 2024 · 0 comments
Labels

Comments

@robbiemie
Copy link
Owner

Promise 相关试题

Promise.resolve('1')
  .then(res => {
    console.log(res)
  })
  .then(() => {
    console.log('finished 1')
  })
  .then(() => {
    console.log('finished 12')
  })
Promise.resolve('2')
  .then(res => {
    console.log(res)
  })
  .then(() => {
    console.log('finished 2')
  })
  .then(() => {
    console.log('finished 22')
  })

console.log(3)

输出

3
1
2
finished 1
finished 2
finished 12
finished 22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant