Preview:
/**
 *
 * @param {string[]} names - an array of ids
 * @param {string[]} names - an array of ids
 * @param {string[]} names - a blank array to push into
 *
 * This function will compare array1 with array2 and if the items dont match then they are pushed to array3
 */
const compareIds = (array1, array2, array3) => {
    array1.forEach((id) => {
        if (!array2.includes(id)) {
            array3.push(id);
        }
    });
};
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter