This method returns a sequence with all the elements from one array, A, that are not present in another array, B. This is the array version of Set's subtract method.
let animals = ["Cow", "Bulldog", "Labrador"] return animals.without(["Bulldog", "Labrador"]) // ["Cow"]
If people are interested in this, then there are a few questions:
- Would it return a lazy sequence or an array? (my preference is a lazy sequence)
- Would it require all elements to conform to Hashable? (my preference is yes, or else we can't guarantee O(n) time, where n is the number of elements in A)