If you’re using the JavaScript engine, something like this should work:
myLayers = [1,12];
containingLayers = [1,2,3,4,5];
success = true;
for (var i = 0; i < myLayers.length; i++){
if (! containingLayers.includes(myLayers[i])){
success = false;
break;
}
}
success