const arr1 = [54, 67, 89, 1, 4, 3, 5, 0, 0, 3]
const arr2 = [5, 5, 6, 7, 8, 3, 2, 5, 7, 453, 54]
function popSort(arr) {
for (let i = 0; i < arr.length; i++) {
for (let j = 0; j < arr.length - 1 - i; j++) {
if (arr[j] > arr[j + 1]) {
let t = arr[j]
arr[j] = arr[j + 1]
arr[j + 1] = t
}
}
}
return arr
}
function handle(a1, a2) {
// let arr = [...a1, ...a2]
// let arrRes = Array.from(new Set(arr));
// return arrRes.sort((a, b) => a - b)
let arr = a1.concat(a2)
let arrObj = {}
let arrRes = []
for (let index = 0; index < arr.length; index++) {
if (!arrObj[arr[index]]) {
arrObj[arr[index]] = true
arrRes.push(arr[index])
}
}
return popSort(arrRes)
}
console.log(handle(arr1, arr2));