I have an array with text strings:
var myarray = ["valueA","valueB","valueC","valueD/valueA","valueE","valueC/valueA"];
Some of the values in the array have a slash, e.g. "aaa/bbb". The slash have a special meaning of separating two values.
I want to get a new array with one value or the other based on a boolean function.
For example:
var myarray = ["valueA/valueB"];
var myNewarray = myFunction(myarray, true); // myNewarray == ["valueA"]
var myNewarray2 = myFunction(myarray, false); // myNewarray2 == ["valueB"]
myarray = ["valueA/valueC","valueB","valueD/valueF"];
myNewarray = myFunction(myarray, true); // ["valueA","valueB","valueD"]
myNewarray = myFunction(myarray, false); // ["valueC","valueB","valueF"]