return index < array.length - 1 ? item < array[index + 1] : true
function mergeArrays(arr1, arr2) {
let result = []
result = result.concat(arr1, arr2).sort((a, b) => a - b)
for (let i = result.length; i > 0; i--) {
if (result[i - 1] != undefined) {
if(result[i] - result[i - 1] === 0) {
result.splice(i, 1)
}
}
}
return result
}