Skip to content

Instantly share code, notes, and snippets.

@lexuanquynh
Last active July 5, 2022 00:35
Show Gist options
  • Save lexuanquynh/86fc57bcb16c470c937c72a2b03e21e0 to your computer and use it in GitHub Desktop.
Save lexuanquynh/86fc57bcb16c470c937c72a2b03e21e0 to your computer and use it in GitHub Desktop.
let numbers = [3, 7, 4, -2, 9, -6, 10, 1]
let firstNegative = numbers.filter { $0 < 0 }.first
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment