If promise.all has two p objects, can't the parameters passed to the callback function be divided into two results?

for example

Promis.all([p1,p2]).then((p1result,p2result)=>{});

if p1 returns [1mem2p3]
p2 returns [4mage5magin6]
the final result is a parameter [1mem2magin3], what should I do if I want to use the results of two p objects respectively?


means you don't understand. The result is not p1result , p2result ? Just use it


Promise.all () also returns a common promise , promise will only have one value, but this value is an array;
according to your description, it should not be the that you said.

var p1 = Promise.resolve([1,2]);
var p2 = Promise.resolve([3,4]);
Promise.all([p1,p2]).then(console.log)

//> [Array(2), Array(2)]
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e8679d-46bb7.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e8679d-46bb7.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?