Pergunta de entrevista da empresa MongoDB

Write a function that removes all duplicates from an array