Skip to content

Instantly share code, notes, and snippets.

@steventswu
steventswu / answer1.js
Created December 13, 2017 10:11
Oursky Developer Pre-Test Answer
/* Returns true if the 2nd array is a subset of 1st array. False otherwise.
*/
function isSubet (arr1, arr2) {
return arr2.every(function (val) {
return arr1.indexOf(val) >= 0;
});
}
/* Example of how the above function works