您的位置:首页 > 博客中心 > 编程语言 >

VUE 取数组交集

时间:2022-03-29 01:44

//produceTypeList-produceType:存在produceTypeList中不存在produceType中
            let diff1 = produceTypeList.filter(function(v){ return produceType.indexOf(v) === -1 }).join(",")

//produceType-produceTypeList:存在produceType中不存在produceTypeList中
            let diff2 = produceType.filter(function(v){ return produceTypeList.indexOf(v) === -1 }).join(",")

 

本类排行

今日推荐

热门手游