I want to get the exact difference between two string arrays.
const array1 = ['T','E','A','P','A','P','E','R'];
const array2 = ['T','A','P'];
Expected Output Array:
['E','A','P','E','R']
I have tried this method:
const output = array1.filter(char => array2.includes(char));
But that removes all instances of a character, like:
['E','E','R']
I'm a newbie, so could you guide me to the right direction?