Skip to content

Instantly share code, notes, and snippets.

@kunyaoxu
Last active May 18, 2018 16:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kunyaoxu/802e94bcedbe7c4375ed6c807d78a957 to your computer and use it in GitHub Desktop.
Save kunyaoxu/802e94bcedbe7c4375ed6c807d78a957 to your computer and use it in GitHub Desktop.
function isSubset(a, b){
for(let index in b){
if(-1 == a.indexOf(b[index]))
return false;
}
return true;
}
a = ["A","B","C","D","E"];
b = ["A","D","E"];
console.log(isSubset(a, b));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment