How to add non-repeating elements in array An and array B to array B?

such as

arrA = [1, 2, 3, 4, 5];
arrB = [1, 1, 2, 3, 3];

want arrB to become [1, 1, 2, 3, 3, 4, 5]

the first idea is to first use a temporary array to save the non-repeating elements in the array AB, and then push them into arrB one by one.
is more troublesome to operate, and intuitively there will be a faster way

.
Aug.16,2021

arrB = arrB.concat (arrA.filter (a = >! arrB.includes (a);


lodash


just finished typing a for loop and found that there is a more concise way upstairs?

for(let i = 0; i < arrA.length; i PP){
  if (arrB.indexOf(arrA[i]) == -1) {
    arrB.push(arrA[i])
  }
}
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-1b3b2b5-2c288.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-1b3b2b5-2c288.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?