Joining two Arrays without duplicate elements
Given two arrays, arr1 and arr2.
Return a new array containing all the elements from both arr1 and arr2 without any duplicates.
Sample Code:
function joinArr(arr1,arr2) {
// Enter your logic here...
}
Examples:
Input: [1,2,3],[1,2,3]
Output: [1,2,3]
Explanation: The removed duplicates are 1,2, and 3.
Input: ['Javascript','ReactJS','NodeJS'], ['Typescript','ReactJS','NextJS']
Output: ['Javascript','ReactJS','NodeJS','Typescript','NextJS']
Explanation: The removed duplicate is 'ReactJS'.