Answers for "check whether an array is subarray of another array"

PHP
4

check if array values exists in another array

$result = !empty(array_intersect($people, $criminals));
Posted by: Guest on April-02-2020
0

javascript check if array is subset of another

let superSet = ['B', 'C', 'A', 'D'];
let subSet = ['D', 'C'];
let mixedSet = new Set([...superSet, ...subSet]);
let isSubset = mixedSet.size == superSet.length
Posted by: Guest on January-18-2021

Code answers related to "check whether an array is subarray of another array"

Browse Popular Code Answers by Language