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

please see code #284

Open
sufuwang opened this issue Mar 23, 2020 · 1 comment
Open

please see code #284

sufuwang opened this issue Mar 23, 2020 · 1 comment

Comments

@sufuwang
Copy link

sufuwang commented Mar 23, 2020

    let a = new Promise(resolve=>resolve(1))
    let b = new Promise(resolve => resolve(a))
    console.info(a === b)           // false

    b = Promise.resolve(a)
    console.info(a === b)            // true

when run code, we will get false and true. what is difference?

@sufuwang
Copy link
Author

My key point:when we input thenable or Promise for resolve of new Promise(resolve => resove()),what happened?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant