https://tishfaroul.medium.com/iterating-through-arrays-with-javascript-solving-the-firstduplicate-algorithm-a80ec4943e09