Skip to content

Instantly share code, notes, and snippets.

@ole
Created July 14, 2021 16:43
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save ole/9946c5236a342b40d478874fadadd230 to your computer and use it in GitHub Desktop.
let evens = Array(1...10)
.lazy
.filter { $0.isMultiple(of: 2) }
evens.indices // → [1, 3, 5, 7, 9]
evens[0] // → 1 (🤯!)
@ole
Copy link
Author

ole commented Jul 14, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment