var p1 = new Promise(function (resolve, reject) {
setTimeout(function(){
resolve(1);
console.log("p1");
},5000)
});
var p2 = new Promise(function (resolve, reject) {
resolve(p1);
}).then(function(data){
console.log(data);
console.log("p2");
})
Why does the result be p1percent = > 1percent = > p2 instead of 1percent = > p2percent = > p1?