const getDataA = () => new Promise(resolve => setTimeout(resolve.bind(null, [1,2,3]), 1000));
const getDataB = () => new Promise(resolve => setTimeout(resolve.bind(null, [2,3,4]), 500));
async function run() {
let A = await getDataA();
let B = await getDataB();
B = [...A.filter(el => !B.includes(el)), ...B]
console.log(B); // [1,2,3,4]
}
run();