Check if val in array and return new array with or without element.