I am trying to achieve a check for duplication and push items to array in the below code the functionality works well but instead of using a null is there any other way of doing it
array2.forEach((item) =>
array1.includes(item)
? null
: array1.push(item),
);