二维数组转一维数组:

//二维数组转一维数组
function flatten(arr) { return [].concat(...arr.map(x => Array.isArray(x) ? flatten(x) : x)) }

对象数组互斥去重:

//对象数组互斥去重
function getArrDifference(arr1, arr2) {
    for (let i in this.arr1) {
        for (let k in this.arr2) {
            if (this.arr1[i].perName == this.arr2[k].perName) {
                this.arr2.splice(k, 1)
            }
        }
    }
}

 

相关文章:

  • 2022-12-23
  • 2021-12-23
猜你喜欢
  • 2021-12-19
  • 2021-12-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-19
相关资源
相似解决方案