Hi, I'm a developer with three year of experience. I am trained in Java/J2e but I am mostly a Javascript/Typescript lover <3 currently working in GIS, with ReactJS and LeafletJS
Doesn't findIndex returns the first value that match the provided testing function? In need all the elements that match the predicate, not only the first one.
a more concise way would be to use the new ES6 spread operator and Set
merge your 2 arrays then
let mergedArray = array1.concat(array2)
const unique = [...new Set(mergedArray.map(item => item.label))];
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Doesn't findIndex returns the first value that match the provided testing function? In need all the elements that match the predicate, not only the first one.
a more concise way would be to use the new ES6 spread operator and Set
merge your 2 arrays then
let mergedArray = array1.concat(array2)
const unique = [...new Set(mergedArray.map(item => item.label))];