Guys, I’m a cicada… Today is “July 10, 2020,” and today is “day 14” of sharing. Recently I got back the interview question Promise has a very high probability of appearing. What I use every day, let’s have another one today! Interview questions are usually given 5-10 minutes to answer, so if you don’t come up with the correct answer within 10 minutes, read it carefully. One is to help the growing partners grow up (big god please ignore), the other is to temper their own will, learn with everyone, grow together… Don’t ask me why I called so many… Mature)


Promise (error handling)

    new Promise(function(resolve) {
        new Error("Error in the body of the Promise function")
    }).then(function() {
        return new Error("Error")
    }).then(function(res) {
 console.log(res)  }).catch(function(err) {  console.log(err)  }) Copy the code

The countdown begins !!!!


You can leave your answers in the comments!! After work in the evening, we discussed…