慕雪6442864
> Array.prototype.distinct = function() {... var temp = this.filter( (item, index) => {..... return this.lastIndexOf(item)===index;..... })... return temp;... }[Function]> console.log(['a', 'b', 'c', 'd', 'b', 'a', 'a', 'e'].distinct());[ 'c', 'd', 'b', 'a', 'e' ]理解箭头函数,还有this