We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make a function that removes elements from the end of an array until the passed function returns true and returns the remaining elements in the array.
The text was updated successfully, but these errors were encountered:
I got this :)
Sorry, something went wrong.
I am not sure thing can be made generic without it being an extension on Collection. Otherwise the call site sorta will have to look like this:
Collection
drop(arr: [1, 2, 3, 4, 5]) { element in guard let element = element as? Int else { return false } return element > 3 }
vs doing something cool like:
drop(arr: [1, 2, 3, 4, 5], while: {$0 > 3})
No branches or pull requests
Make a function that removes elements from the end of an array until the passed function returns true and returns the remaining elements in the array.
The text was updated successfully, but these errors were encountered: