Q-Centrix Interview Question

How do you write a function that removes duplicated elements in an array?