2017-06-23 17:08:11 +02:00
|
|
|
/**
|
|
|
|
* Verify that a subArray is contained within an array.
|
|
|
|
*
|
|
|
|
* @param {Array} array
|
2017-06-23 18:07:34 +02:00
|
|
|
* @param {Array} subArray
|
2017-06-23 17:08:11 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
function arrayContains(array, subArray) {
|
2017-04-13 16:37:32 +02:00
|
|
|
var found;
|
2017-06-23 17:08:11 +02:00
|
|
|
for (var i = 0; i < subArray.length; i++) {
|
2017-04-13 16:37:32 +02:00
|
|
|
found = false;
|
2017-06-23 17:08:11 +02:00
|
|
|
for (var j = 0; j < array.length; j++) {
|
|
|
|
if (subArray[i] === array[j]) {
|
2017-04-13 16:37:32 +02:00
|
|
|
found = true;
|
|
|
|
break;
|
|
|
|
}
|
2014-07-19 00:22:37 +02:00
|
|
|
}
|
2017-04-13 16:37:32 +02:00
|
|
|
if (!found) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return true;
|
2014-07-19 00:22:37 +02:00
|
|
|
}
|