Remove duplicates from JavaScript arrays