Skip to content

Instantly share code, notes, and snippets.

@corlaez
Created September 6, 2019 13:33
Show Gist options
  • Save corlaez/9a6a720d799dc5f4ec855d18d50bcb68 to your computer and use it in GitHub Desktop.
Save corlaez/9a6a720d799dc5f4ec855d18d50bcb68 to your computer and use it in GitHub Desktop.
subs utils
function merge(l1, l2) {
const se = new Set(l1);
l2.forEach(e => se.add(e))
return [...se]
}
const x = Object.keys(old).reduce((acc, cur) => {
acc[cur] = merge(old[cur], neww[cur]);
return acc
}, {})
let y = null;
y = merge(old.DF5, old.DF16)
y = merge(y, old.DF19)
y = merge(y, old.DF20)
y = merge(y, old.DF21)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment