Skip to content

Instantly share code, notes, and snippets.

@Li-Bot

Li-Bot/performance_filter.swift Secret

Last active Mar 11, 2020
Embed
What would you like to do?
// Swift
let colds = fahrenheit.filter { (degreesFahrenheit) -> Bool in
return degreesFahrenheit <= 68.0
}
// For-in loop
var colds = [Double]()
for degreesFahrenheit in fahrenheit {
if degreesFahrenheit <= 68.0 {
colds.append(degreesFahrenheit)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.