SOURCE

function unique(arr,key){
    let hash = {}
    let res = arr.reduce((total,current)=>{
        if(!hash[current[key]]){
            hash[current[key]]=true
            total.push(current)
        }
        return total
    },[])
    return res
}
console 命令行工具 X clear

                    
>
console