I'm trying to figure out how to add an item to an array based on the return value of a method.
Something like where in a method you can do
return array.contains(value)
I think what you mean is this:
if(array.contains(value)){
array2.add(value)
}