Skip to content

Instantly share code, notes, and snippets.

@alex-boom
Created March 12, 2021 15:59
Show Gist options
  • Save alex-boom/2d34acfbd43df951a94997b5fcffeecd to your computer and use it in GitHub Desktop.
Save alex-boom/2d34acfbd43df951a94997b5fcffeecd to your computer and use it in GitHub Desktop.
const arrs = [
["General Fitness", "Health & Fitness"],
["Cardiovascular", "Meditation"],
["Health & Fitness", "Cardiovascular", "General Fitness"],
["Cardiovascular"]
];
const result = [...new Set([].concat(...arrs))];
console.log(result);
//example
const arrs = dataQuery && dataQuery.map(
item => item.translation.map(i => i.locale)
)
const result = [...new Set([].concat(...arrs))];
console.log(result);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment