Skip to content

Instantly share code, notes, and snippets.

@Li-Bot Li-Bot/performance_map.swift Secret

Last active Mar 11, 2020
Embed
What would you like to do?
// Swift
let celsius = fahrenheit.map { (degreesFahrenheit) -> Double in
return (degreesFahrenheit - 32.0) / 1.8
}
// For-in loop
var celsius = [Double]()
for degreesFahrenheit in fahrenheit {
celsius.append((degreesFahrenheit - 32.0) / 1.8)
}
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.