Today I saw Taobao's online recruitment on bluediea. I believed that Taobao's technology is still very good, so I quickly opened it, took a look at the questions and tried to do it.
When I got to the third question, I was stuck for a long time. It wasn’t that I couldn’t do it. I felt that there was a very simple method but I couldn’t think of it at the moment. However, after a lot of effort, I finally completed this question and gave the answer. An answer that I am quite satisfied with, welcome your suggestions!
The question is as follows:
Please add a prototype method to the Array local object. Its purpose is to delete duplicate entries (there may be multiple) in the array entries. The return value is a value that only contains the deleted duplicates. A new array of entries.