Check if array A has all elements of array B let a = [1,2,3], b = [1,2,3,4], c = [1,2]; let checkEvery = (arr, target) => target.every(el => arr.includes(el)); console.log(checkEvery(b, a)) // true console.log(checkEvery(c, a)) ...
Markdown supported · ⌘↵ to post
No responses yet.