过滤数组中的(多个)指定值

JavaScript

const without = (arr, ...args) => arr.filter(v => !args.includes(v))

Examples

without([2, 1, 2, 3], 1, 2) // [3]

posted on 2022-09-07 09:57  小馬過河﹎  阅读(19)  评论(0)    收藏  举报

导航