Created
March 12, 2021 15:59
-
-
Save alex-boom/2d34acfbd43df951a94997b5fcffeecd 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
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