const names = ["Daniel", "Lucas", "Gwen", "Henry", "Jasper"];
const random = ["hi", "Lucas", "apple", "banana", "Jasper", "hello", "meow"];
What I want here is to compare names
and random
, if there are any duplicates in random, remove them and have an outcome like this.
const newArr = ["hi", "apple", "banana", "hello", "meow"]
How can I do that with React?