Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * @param {Array} target 目标数组
- * @param {Array} arr 需要查询的数组
- * @description 判断要查询的数组是否至少有一个元素包含在目标数组中
- */
- export const hasOneOf = (targetarr, arr) => {
- return targetarr.some(_ => arr.indexOf(_) > -1)
- }
Add Comment
Please, Sign In to add comment