前端_Promise面试题 4

钎探穗

关注

阅读 64

2022-02-14

题目一 

    Promise.resolve(1)
    .then(
      value => {
        console.log(value);
        return 2
      }
    )
    .then(console.log)


题目二 

    Promise.resolve(1)
    .then(
      value => {
        console.log(value);
        return 2
      }
    )
    .then(
      value => {
        console.log
      }
    )

题目三

    Promise.resolve(1)
    .then(
      value => {
        console.log(value);
        return 2
      }
    )
    .then(
      value => {
        console.log(value)
      }
    )

 


题目四 

    Promise.resolve(1)
    .then(2)
    .then(Promise.resolve(3))
    .then(console.log)

精彩评论(0)

0 0 举报