I want to remove all elements of value x from an array that contains x, y and z elements
let arr = [\'a\', \'b\', \'c\', \'b\']
How can I r
EDITED according to comments:
I like this approach:
var arr = ["a", "b", "c", "b"] while let idx = arr.index(of:"b") { arr.remove(at: idx) }
Original answer (before editing):
let arr = ['a', 'b', 'c', 'b'] if let idx = arr.index(of:"b") { arr.remove(at: idx) }