Skip to content

Instantly share code, notes, and snippets.

@dhruvangg
Last active January 12, 2021 11:04
Show Gist options
  • Save dhruvangg/7d6b3748baf403ab95f8c52ef107b083 to your computer and use it in GitHub Desktop.
Save dhruvangg/7d6b3748baf403ab95f8c52ef107b083 to your computer and use it in GitHub Desktop.
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