const array1 = [1, 2, 3];
const array2 = [4, 5, 6];

// Concatenate two arrays
const twoConcatArray = array1.concat(array2);
console.log(twoConcatArray); // Output: [1, 2, 3, 4, 5, 6]

// Concatenate three arrays
const array3 = [6, 7, 8];
const threeConcatArray = array1.concat(array2, array3);
console.log(threeConcatArray); // Output: [1, 2, 3, 4, 5, 6, 6, 7, 8]

// Concatenate array with one or more values
const arrayWithValues = array1.concat(9, 10, 11);
console.log(arrayWithValues); // Output: [1, 2, 3, 9, 10, 11]
arr.concat(value1[, ...[, valueN]])
// Create two arrays
const arr1 = [1, 2, 3];
const arr2 = [3, 4, 5];

// Use concat() to combine the two arrays
const concatenatedArray = arr1.concat(arr2);
console.log(concatenatedArray); // Output: [1, 2, 3, 3, 4, 5]
// Create three arrays
const arr1 = [1, 2, 3];
const arr2 = [3, 4, 5];
const arr3 = [7, 8, 9];

// Use concat() to combine the three arrays
const concatenatedArray = arr1.concat(arr2, arr3);
console.log(concatenatedArray); // Output: [1, 2, 3, 3, 4, 5, 7, 8, 9]
// Create an array to use with concat()
const arr1 = ["a", "b", "c"];

// Use concat() to add values to the array
const concatenatedArray = arr1.concat(1);
console.log(concatenatedArray); // Output: ['a', 'b', 'c', 1]
// Create two arrays
const arr1 = [1, 2, 3];
const arr2 = [3, 4, 5];

// Use concat() to combine the two arrays
const concatenatedArray = arr1.concat(arr2);

// Use Set to remove duplicates
// Use spread (...) syntax to convert back to an array
const uniqueArray = [...new Set(concatenatedArray)];

console.log(uniqueArray); // Output: [1, 2, 3, 4, 5]
// Create two arrays
const arr1 = [1, 2, 3];
const arr2 = [3, 4, 5];

// Use concat() to combine the two arrays
const concatenatedArray = arr1.concat(arr2);

// Use filter() to remove duplicates
const uniqueArray = concatenatedArray.filter((item, index) => {
    return concatenatedArray.indexOf(item) === index;
});

console.log(uniqueArray); // Output: [1, 2, 3, 4, 5]