Created
August 30, 2017 14:29
-
-
Save aherve/0b76f959005a23249bdd679136833475 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// subtract two sets | |
const s1 = [ 1, 2, 3, 4, 5 ] | |
const s2 = [ 2, 4 ] | |
const subtracted = s1.filter(x => s2.indexOf(x) < 0) | |
console.log(subtracted) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment