Metafic interview question

remove duplicates from an array solve using javaScript