Pretty basic question here I think but not one I could find an answer for - I have a bunch of arrays that I want to extract unique values from. Each array has a list of skills a candidate is proficient in and I want to build an array that lists all skills that have been listed.
This is the code I have which lists a persons name and the skills they have:
const people = [
{ name: "Mike", skills: ["JavaScript", "Java", "Python"] },
{ name: "Bob", skills: ["Python", "Java"] },
];
What I want to do is build an array with each skill listed above only appearing once, no matter how many times its in the arrays above. I have tried using the Set feature as follows:
let options = [...new Set(people)]
but that dosent work for me. Ideally I want the output to be something like:
options["JavaScript", "Java", "Python"]
where each unique value is represented only once. Any help is appreciated.