Last active
January 12, 2021 11:04
-
-
Save dhruvangg/7d6b3748baf403ab95f8c52ef107b083 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
let a = [1,2,3], | |
b = [1,2,3,4], | |
c = [1,2]; | |
let checkEvery = (arr, target) => target.every(el => arr.includes(el)); | |
console.log(checkEvery(b, a)) // true | |
console.log(checkEvery(c, a)) // false | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment