found an interesting piece of code in it
Promise.prototype["finally"] = function(callback) {
var constructor = this.constructor
return this.then(
function(value){
return constructor.resolve(callback()).then(function(){
return value;
})
},
function(reason){
return constructor.resolve(callback()).then(function(){
return constructor.reject(reason)
})
}
)
}
this code is how to simulate the function of finally, solve, thank you!