Magenic interview question

Write a function to remove duplicates from an array.