Last active
May 18, 2018 16:53
-
-
Save kunyaoxu/802e94bcedbe7c4375ed6c807d78a957 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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