I am checking for the existence of a certain value in a array and if it's there I want to assign a value that that is specific for the value from the myArray. The code below works, but there is a lot of repetition. Is there a better way of doing things?

```
const myArray = ['a', 'b', 'c', 'd'];
const aExists = myArray.indexOf('a') > -1;
const bExists = myArray.indexOf('b') > -1;
const cExists = myArray.indexOf('c') > -1;

return [
    (aExists ? 'value-for-a' : undefined),
    (bExists ? 'or-something-for-b' : undefined),
    (cExists ? 'different-value-for-c' : undefined)
].filter(x => x !== undefined).toString();

```