var hash = {}; this.selectOptions = this.selectOptions.reduce(function(item, next) { hash[next.cast_id] ? '' : hash[next.cast_id] = true && item.push(next); return item }, [])
js对数组中的对象去重
最新推荐文章于 2024-07-22 18:34:51 发布
var hash = {}; this.selectOptions = this.selectOptions.reduce(function(item, next) { hash[next.cast_id] ? '' : hash[next.cast_id] = true && item.push(next); return item }, [])