Skip to content

Instantly share code, notes, and snippets.

@cakesmith
Created September 30, 2016 17:50
Show Gist options
  • Save cakesmith/d7e85c70461ab70a350f7df340e8fb77 to your computer and use it in GitHub Desktop.
Save cakesmith/d7e85c70461ab70a350f7df340e8fb77 to your computer and use it in GitHub Desktop.
ES6 Diff Set
function diffSet(a, b) {
let x = new Set([...a].filter(n => !b.has(n)));
let y = new Set([...b].filter(n => !a.has(n)));
return new Set([...x, ...y]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment