I have an array of fruits. I am fetching a fruit randomly (see following codes). Question: How do I remove this fruit from the array after fetching it?
let fruits = ["apple", "orange", "banana", "pineapple", "lemon" ]
func getRandomFruit() -> String {
let randomFruit = fruits.randomElement()!
return randomFruit
}