The input array (
arr2) are multi-dimensional arrays so it is needed to make them to 1d array using
After making it to
1d array, you can get the unduplicated members using
Array.prototype.filterfunction. (To check if the arr2 includes the item or not, you can use
const arr1 = [ ['11:00','12:00','13:00'] ]; const arr2 = [ ['11:00'],['13:00'] ]; const arr1Flat = arr1.flat(); const arr2Flat = arr2.flat(); const output = arr1Flat.filter((item) => !arr2Flat.includes(item)); console.log(output);
CLICK HERE to find out more related problems solutions.